|
1 | 1 | (ns codes.clj.docs.frontend.test.panels.dashboard.components-test
|
2 | 2 | (:require [cljs.test :refer [async deftest is testing use-fixtures]]
|
| 3 | + [clojure.string :as str] |
3 | 4 | [codes.clj.docs.frontend.panels.dashboards.components :as components]
|
| 5 | + [codes.clj.docs.frontend.test.aux.fixtures.dashboards :as fixtures] |
4 | 6 | [codes.clj.docs.frontend.test.aux.init :refer [async-cleanup
|
5 | 7 | async-setup]]
|
6 | 8 | [codes.clj.docs.frontend.test.aux.testing-library :as tl]
|
7 |
| - [codes.clj.docs.frontend.test.aux.fixtures.dashboards :as fixtures] |
8 | 9 | [helix.core :refer [$]]
|
9 | 10 | [matcher-combinators.test :refer [match?]]
|
10 | 11 | [promesa.core :as p]))
|
|
19 | 20 | :error nil})
|
20 | 21 |
|
21 | 22 | (def top-authors-response
|
22 |
| - {:value fixtures/top-authors |
23 |
| - :loading? false |
| 23 | + {:value fixtures/top-authors :loading? false |
24 | 24 | :error nil})
|
25 | 25 |
|
26 | 26 | (deftest latest-interactions-component-test
|
|
57 | 57 | #(-> (tl/mantine-render ($ components/top-authors-list {:& top-authors-response}))
|
58 | 58 | (.findByTestId "top-authors-list")))]
|
59 | 59 |
|
60 |
| - (is (match? ["http://localhost:5002/author/rafaeldelboni/github" |
61 |
| - "http://localhost:5002/author/vloth/github" |
62 |
| - "http://localhost:5002/author/matheusfrancisco/github" |
63 |
| - "http://localhost:5002/author/strobelt/github" |
64 |
| - "http://localhost:5002/author/kroncatti/github" |
65 |
| - "http://localhost:5002/author/dimmyjr-nu/github" |
66 |
| - "http://localhost:5002/author/daveliepmann/github"] |
| 60 | + (is (match? [["rafaeldelboni" "github"] |
| 61 | + ["vloth" "github"] |
| 62 | + ["matheusfrancisco" "github"] |
| 63 | + ["strobelt" "github"] |
| 64 | + ["kroncatti" "github"] |
| 65 | + ["dimmyjr-nu" "github"] |
| 66 | + ["daveliepmann" "github"]] |
67 | 67 | (->> (.querySelectorAll top-authors-list ".author-interaction-anchor")
|
68 | 68 | (map (fn [top-author]
|
69 |
| - (js/console.log top-author) |
70 |
| - (.-href top-author)))))) |
| 69 | + (-> top-author |
| 70 | + .-href |
| 71 | + (str/split "/") |
| 72 | + (->> (drop 4)))))))) |
71 | 73 |
|
72 | 74 | (done))
|
73 | 75 | (fn [err] (is (= nil err))
|
|
0 commit comments