@@ -8,12 +8,28 @@ import { setupApplicationTest } from 'cargo/tests/helpers';
8
8
9
9
import axeConfig from '../axe-config' ;
10
10
11
- module ( 'Acceptance | /crates/:name/owners ' , function ( hooks ) {
11
+ module ( 'Acceptance | /crates/:name/settings ' , function ( hooks ) {
12
12
setupApplicationTest ( hooks ) ;
13
13
14
14
test ( 'listing crate owners' , async function ( assert ) {
15
15
this . server . loadFixtures ( ) ;
16
16
17
+ await visit ( '/crates/nanomsg/settings' ) ;
18
+
19
+ assert . dom ( '[data-test-owners] [data-test-owner-team]' ) . exists ( { count : 2 } ) ;
20
+ assert . dom ( '[data-test-owners] [data-test-owner-user]' ) . exists ( { count : 2 } ) ;
21
+ assert . dom ( 'a[href="/teams/github:org:thehydroimpulse"]' ) . exists ( ) ;
22
+ assert . dom ( 'a[href="/teams/github:org:blabaere"]' ) . exists ( ) ;
23
+ assert . dom ( 'a[href="/users/thehydroimpulse"]' ) . exists ( ) ;
24
+ assert . dom ( 'a[href="/users/blabaere"]' ) . exists ( ) ;
25
+
26
+ await percySnapshot ( assert ) ;
27
+ await a11yAudit ( axeConfig ) ;
28
+ } ) ;
29
+
30
+ test ( 'redirecting and listing crate owners' , async function ( assert ) {
31
+ this . server . loadFixtures ( ) ;
32
+
17
33
await visit ( '/crates/nanomsg/owners' ) ;
18
34
19
35
assert . dom ( '[data-test-owners] [data-test-owner-team]' ) . exists ( { count : 2 } ) ;
@@ -30,15 +46,15 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
30
46
test ( 'attempting to add owner without username' , async function ( assert ) {
31
47
this . server . loadFixtures ( ) ;
32
48
33
- await visit ( '/crates/nanomsg/owners ' ) ;
49
+ await visit ( '/crates/nanomsg/settings ' ) ;
34
50
await fillIn ( 'input[name="username"]' , '' ) ;
35
51
assert . dom ( '[data-test-save-button]' ) . isDisabled ( ) ;
36
52
} ) ;
37
53
38
54
test ( 'attempting to add non-existent owner' , async function ( assert ) {
39
55
this . server . loadFixtures ( ) ;
40
56
41
- await visit ( '/crates/nanomsg/owners ' ) ;
57
+ await visit ( '/crates/nanomsg/settings ' ) ;
42
58
await fillIn ( 'input[name="username"]' , 'spookyghostboo' ) ;
43
59
await click ( '[data-test-save-button]' ) ;
44
60
@@ -52,7 +68,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
52
68
test ( 'add a new owner' , async function ( assert ) {
53
69
this . server . loadFixtures ( ) ;
54
70
55
- await visit ( '/crates/nanomsg/owners ' ) ;
71
+ await visit ( '/crates/nanomsg/settings ' ) ;
56
72
await fillIn ( 'input[name="username"]' , 'iain8' ) ;
57
73
await click ( '[data-test-save-button]' ) ;
58
74
@@ -64,7 +80,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
64
80
test ( 'remove a crate owner when owner is a user' , async function ( assert ) {
65
81
this . server . loadFixtures ( ) ;
66
82
67
- await visit ( '/crates/nanomsg/owners ' ) ;
83
+ await visit ( '/crates/nanomsg/settings ' ) ;
68
84
await click ( '[data-test-owner-user="thehydroimpulse"] [data-test-remove-owner-button]' ) ;
69
85
70
86
assert . dom ( '[data-test-notification-message="success"]' ) . hasText ( 'User thehydroimpulse removed as crate owner' ) ;
@@ -86,7 +102,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
86
102
87
103
this . authenticateAs ( user ) ;
88
104
89
- await visit ( `/crates/${ crate . name } /owners ` ) ;
105
+ await visit ( `/crates/${ crate . name } /settings ` ) ;
90
106
await click ( `[data-test-owner-user="${ user2 . login } "] [data-test-remove-owner-button]` ) ;
91
107
92
108
assert
@@ -98,7 +114,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
98
114
test ( 'remove a crate owner when owner is a team' , async function ( assert ) {
99
115
this . server . loadFixtures ( ) ;
100
116
101
- await visit ( '/crates/nanomsg/owners ' ) ;
117
+ await visit ( '/crates/nanomsg/settings ' ) ;
102
118
await click ( '[data-test-owner-team="github:org:thehydroimpulse"] [data-test-remove-owner-button]' ) ;
103
119
104
120
assert
@@ -122,7 +138,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
122
138
123
139
this . authenticateAs ( user ) ;
124
140
125
- await visit ( `/crates/${ crate . name } /owners ` ) ;
141
+ await visit ( `/crates/${ crate . name } /settings ` ) ;
126
142
await click ( `[data-test-owner-team="${ team . login } "] [data-test-remove-owner-button]` ) ;
127
143
128
144
assert
0 commit comments