1
- import { click , fillIn , visit } from '@ember/test-helpers' ;
1
+ import { click , currentURL , fillIn , visit } from '@ember/test-helpers' ;
2
2
import { module , test } from 'qunit' ;
3
3
4
4
import percySnapshot from '@percy/ember' ;
@@ -8,13 +8,14 @@ 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/owners' ) ;
17
+ await visit ( '/crates/nanomsg/settings' ) ;
18
+ assert . equal ( currentURL ( ) , '/crates/nanomsg/settings' ) ;
18
19
19
20
assert . dom ( '[data-test-owners] [data-test-owner-team]' ) . exists ( { count : 2 } ) ;
20
21
assert . dom ( '[data-test-owners] [data-test-owner-user]' ) . exists ( { count : 2 } ) ;
@@ -27,18 +28,25 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
27
28
await a11yAudit ( axeConfig ) ;
28
29
} ) ;
29
30
30
- test ( 'attempting to add owner without username ' , async function ( assert ) {
31
+ test ( '/crates/:name/owners redirects to /crates/:name/settings ' , async function ( assert ) {
31
32
this . server . loadFixtures ( ) ;
32
33
33
34
await visit ( '/crates/nanomsg/owners' ) ;
35
+ assert . equal ( currentURL ( ) , '/crates/nanomsg/settings' ) ;
36
+ } ) ;
37
+
38
+ test ( 'attempting to add owner without username' , async function ( assert ) {
39
+ this . server . loadFixtures ( ) ;
40
+
41
+ await visit ( '/crates/nanomsg/settings' ) ;
34
42
await fillIn ( 'input[name="username"]' , '' ) ;
35
43
assert . dom ( '[data-test-save-button]' ) . isDisabled ( ) ;
36
44
} ) ;
37
45
38
46
test ( 'attempting to add non-existent owner' , async function ( assert ) {
39
47
this . server . loadFixtures ( ) ;
40
48
41
- await visit ( '/crates/nanomsg/owners ' ) ;
49
+ await visit ( '/crates/nanomsg/settings ' ) ;
42
50
await fillIn ( 'input[name="username"]' , 'spookyghostboo' ) ;
43
51
await click ( '[data-test-save-button]' ) ;
44
52
@@ -52,7 +60,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
52
60
test ( 'add a new owner' , async function ( assert ) {
53
61
this . server . loadFixtures ( ) ;
54
62
55
- await visit ( '/crates/nanomsg/owners ' ) ;
63
+ await visit ( '/crates/nanomsg/settings ' ) ;
56
64
await fillIn ( 'input[name="username"]' , 'iain8' ) ;
57
65
await click ( '[data-test-save-button]' ) ;
58
66
@@ -64,7 +72,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
64
72
test ( 'remove a crate owner when owner is a user' , async function ( assert ) {
65
73
this . server . loadFixtures ( ) ;
66
74
67
- await visit ( '/crates/nanomsg/owners ' ) ;
75
+ await visit ( '/crates/nanomsg/settings ' ) ;
68
76
await click ( '[data-test-owner-user="thehydroimpulse"] [data-test-remove-owner-button]' ) ;
69
77
70
78
assert . dom ( '[data-test-notification-message="success"]' ) . hasText ( 'User thehydroimpulse removed as crate owner' ) ;
@@ -86,7 +94,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
86
94
87
95
this . authenticateAs ( user ) ;
88
96
89
- await visit ( `/crates/${ crate . name } /owners ` ) ;
97
+ await visit ( `/crates/${ crate . name } /settings ` ) ;
90
98
await click ( `[data-test-owner-user="${ user2 . login } "] [data-test-remove-owner-button]` ) ;
91
99
92
100
assert
@@ -98,7 +106,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
98
106
test ( 'remove a crate owner when owner is a team' , async function ( assert ) {
99
107
this . server . loadFixtures ( ) ;
100
108
101
- await visit ( '/crates/nanomsg/owners ' ) ;
109
+ await visit ( '/crates/nanomsg/settings ' ) ;
102
110
await click ( '[data-test-owner-team="github:org:thehydroimpulse"] [data-test-remove-owner-button]' ) ;
103
111
104
112
assert
@@ -122,7 +130,7 @@ module('Acceptance | /crates/:name/owners', function (hooks) {
122
130
123
131
this . authenticateAs ( user ) ;
124
132
125
- await visit ( `/crates/${ crate . name } /owners ` ) ;
133
+ await visit ( `/crates/${ crate . name } /settings ` ) ;
126
134
await click ( `[data-test-owner-team="${ team . login } "] [data-test-remove-owner-button]` ) ;
127
135
128
136
assert
0 commit comments