|
1 | 1 | (ns clojars.integration.group-verification-test |
2 | 2 | (:require |
| 3 | + [clj-http.client :as http] |
3 | 4 | [clojars.integration.steps :refer [register-as]] |
4 | 5 | [clojars.test-helper :as help] |
5 | 6 | [clojure.test :refer [deftest use-fixtures]] |
6 | 7 | [kerodon.core :refer [fill-in follow-redirect |
7 | 8 | press session visit within]] |
8 | | - [kerodon.test :refer [has some-text?]] |
9 | | - [clj-http.client :as http])) |
| 9 | + [kerodon.test :refer [has some-text?]])) |
10 | 10 |
|
11 | 11 | (use-fixtures :each |
12 | 12 | help/default-fixture |
|
19 | 19 | (follow-redirect) |
20 | 20 | (visit "/verify/group") |
21 | 21 | (within [:div.via-txt] |
22 | | - (fill-in "Group name" "com.example") |
23 | | - (fill-in "Domain with TXT record" "example.com") |
24 | | - (press "Verify Group")) |
| 22 | + (fill-in "Group name" "com.example") |
| 23 | + (fill-in "Domain with TXT record" "example.com") |
| 24 | + (press "Verify Group")) |
25 | 25 | (follow-redirect) |
26 | 26 | (within [:div.info] |
27 | | - (has (some-text? "The group 'com.example' has been verified")))))) |
| 27 | + (has (some-text? "The group 'com.example' has been verified")))))) |
28 | 28 |
|
29 | 29 | (deftest user-cannot-verify-non-corresponding-group |
30 | 30 | (help/with-TXT ["clojars dantheman"] |
|
33 | 33 | (follow-redirect) |
34 | 34 | (visit "/verify/group") |
35 | 35 | (within [:div.via-txt] |
36 | | - (fill-in "Group name" "com.example") |
37 | | - (fill-in "Domain with TXT record" "example.org") |
38 | | - (press "Verify Group")) |
| 36 | + (fill-in "Group name" "com.example") |
| 37 | + (fill-in "Domain with TXT record" "example.org") |
| 38 | + (press "Verify Group")) |
39 | 39 | (follow-redirect) |
40 | 40 | (within [:div.error] |
41 | | - (has (some-text? "Group and domain do not correspond with each other")))))) |
| 41 | + (has (some-text? "Group and domain do not correspond with each other")))))) |
42 | 42 |
|
43 | 43 | (deftest user-can-verify-sub-group |
44 | 44 | (help/with-TXT ["clojars dantheman"] |
|
47 | 47 | (follow-redirect) |
48 | 48 | (visit "/verify/group") |
49 | 49 | (within [:div.via-txt] |
50 | | - (fill-in "Group name" "com.example") |
51 | | - (fill-in "Domain with TXT record" "example.com") |
52 | | - (press "Verify Group")) |
| 50 | + (fill-in "Group name" "com.example") |
| 51 | + (fill-in "Domain with TXT record" "example.com") |
| 52 | + (press "Verify Group")) |
53 | 53 | (follow-redirect) |
54 | 54 | (within [:div.info] |
55 | | - (has (some-text? "The group 'com.example' has been verified"))) |
| 55 | + (has (some-text? "The group 'com.example' has been verified"))) |
56 | 56 |
|
57 | 57 | (within [:div.via-parent] |
58 | | - (fill-in "Group name" "com.example.ham") |
59 | | - (press "Verify Group")) |
| 58 | + (fill-in "Group name" "com.example.ham") |
| 59 | + (press "Verify Group")) |
60 | 60 | (follow-redirect) |
61 | 61 | (within [:div.info] |
62 | | - (has (some-text? "The group 'com.example.ham' has been verified")))))) |
| 62 | + (has (some-text? "The group 'com.example.ham' has been verified")))))) |
63 | 63 |
|
64 | 64 | (deftest user-cannot-verify-subgroup-with-non-verified-parent |
65 | 65 | (-> (session (help/app)) |
66 | 66 | (register-as "dantheman" "test@example.org" "password") |
67 | 67 | (follow-redirect) |
68 | 68 | (visit "/verify/group") |
69 | 69 | (within [:div.via-parent] |
70 | | - (fill-in "Group name" "com.example") |
71 | | - (press "Verify Group")) |
| 70 | + (fill-in "Group name" "com.example") |
| 71 | + (press "Verify Group")) |
72 | 72 | (follow-redirect) |
73 | 73 | (within [:div.error] |
74 | | - (has (some-text? "The group is not a subgroup of a verified group"))))) |
| 74 | + (has (some-text? "The group is not a subgroup of a verified group"))))) |
75 | 75 |
|
76 | 76 | (deftest user-can-verify-vcs-groups |
77 | 77 | (with-redefs [http/head (constantly {:status 200})] |
|
80 | 80 | (follow-redirect) |
81 | 81 | (visit "/verify/group") |
82 | 82 | (within [:div.via-vcs] |
83 | | - (fill-in "Verification Repository URL" |
84 | | - "https://github.com/example/clojars-dantheman") |
85 | | - (press "Verify Groups")) |
| 83 | + (fill-in "Verification Repository URL" |
| 84 | + "https://github.com/example/clojars-dantheman") |
| 85 | + (press "Verify Groups")) |
86 | 86 | (follow-redirect) |
87 | 87 | (within [:div.info] |
88 | | - (has (some-text? "The groups 'com.github.example' & 'net.github.example' have been verified")))))) |
| 88 | + (has (some-text? "The groups 'com.github.example' & 'net.github.example' have been verified")))))) |
89 | 89 |
|
90 | 90 | (deftest user-cannot-verify-vcs-groups-with-missing-repo |
91 | 91 | (with-redefs [http/head (constantly {:status 404})] |
|
94 | 94 | (follow-redirect) |
95 | 95 | (visit "/verify/group") |
96 | 96 | (within [:div.via-vcs] |
97 | | - (fill-in "Verification Repository URL" |
98 | | - "https://github.com/example/clojars-dantheman") |
99 | | - (press "Verify Groups")) |
| 97 | + (fill-in "Verification Repository URL" |
| 98 | + "https://github.com/example/clojars-dantheman") |
| 99 | + (press "Verify Groups")) |
100 | 100 | (follow-redirect) |
101 | 101 | (within [:div.error] |
102 | | - (has (some-text? "The verification repo does not exist")))))) |
| 102 | + (has (some-text? "The verification repo does not exist")))))) |
0 commit comments