Skip to content

Commit 5fe1d83

Browse files
committed
fix(dashboard): unit url tests
1 parent 7cc75d3 commit 5fe1d83

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/codes/clj/docs/frontend/test/panels/dashboard/components_test.cljs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
(ns codes.clj.docs.frontend.test.panels.dashboard.components-test
22
(:require [cljs.test :refer [async deftest is testing use-fixtures]]
3+
[clojure.string :as str]
34
[codes.clj.docs.frontend.panels.dashboards.components :as components]
5+
[codes.clj.docs.frontend.test.aux.fixtures.dashboards :as fixtures]
46
[codes.clj.docs.frontend.test.aux.init :refer [async-cleanup
57
async-setup]]
68
[codes.clj.docs.frontend.test.aux.testing-library :as tl]
7-
[codes.clj.docs.frontend.test.aux.fixtures.dashboards :as fixtures]
89
[helix.core :refer [$]]
910
[matcher-combinators.test :refer [match?]]
1011
[promesa.core :as p]))
@@ -19,8 +20,7 @@
1920
:error nil})
2021

2122
(def top-authors-response
22-
{:value fixtures/top-authors
23-
:loading? false
23+
{:value fixtures/top-authors :loading? false
2424
:error nil})
2525

2626
(deftest latest-interactions-component-test
@@ -57,17 +57,19 @@
5757
#(-> (tl/mantine-render ($ components/top-authors-list {:& top-authors-response}))
5858
(.findByTestId "top-authors-list")))]
5959

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"]]
6767
(->> (.querySelectorAll top-authors-list ".author-interaction-anchor")
6868
(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))))))))
7173

7274
(done))
7375
(fn [err] (is (= nil err))

0 commit comments

Comments
 (0)