@@ -29,9 +29,9 @@ test('Updating avatar with too large image produces a failure', async () => {
29
29
const imagePicker = screen . getByTitle ( 'Change avatar' ) ;
30
30
31
31
await user . upload ( imagePicker , FakeUsersEndpointApi . largeImageFile ) ;
32
+ expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 1 ) ;
32
33
const avatar = screen . queryByTitle < HTMLImageElement > ( 'Avatar' ) ;
33
34
expect ( avatar ) . not . to . exist ;
34
- expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 1 ) ;
35
35
} ) ;
36
36
37
37
test ( 'Updating avatar with invalid image produces a failure' , async ( ) => {
@@ -41,9 +41,9 @@ test('Updating avatar with invalid image produces a failure', async () => {
41
41
const imagePicker = screen . getByTitle ( 'Change avatar' ) ;
42
42
43
43
await user . upload ( imagePicker , FakeUsersEndpointApi . notImageFile ) ;
44
+ expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 1 ) ;
44
45
const avatar = screen . queryByTitle < HTMLImageElement > ( 'Avatar' ) ;
45
46
expect ( avatar ) . not . to . exist ;
46
- expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 1 ) ;
47
47
} ) ;
48
48
49
49
test ( 'Updating avatar with valid image produces no failures' , async ( ) => {
@@ -53,9 +53,9 @@ test('Updating avatar with valid image produces no failures', async () => {
53
53
const imagePicker = screen . getByTitle ( 'Change avatar' ) ;
54
54
55
55
await user . upload ( imagePicker , FakeUsersEndpointApi . normalImageFile ) ;
56
+ expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . be . empty ;
56
57
const avatar = screen . getByTitle < HTMLImageElement > ( 'Avatar' ) ;
57
58
expect ( avatar . src ) . to . contain ( FakeUsersEndpointApi . normalImageFile . name ) ;
58
- expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 0 ) ;
59
59
} ) ;
60
60
61
61
test ( 'Removing avatar produces no failures' , async ( ) => {
@@ -67,9 +67,9 @@ test('Removing avatar produces no failures', async () => {
67
67
await user . upload ( imagePicker , FakeUsersEndpointApi . normalImageFile ) ;
68
68
69
69
await user . click ( remove ) ;
70
+ expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . be . empty ;
70
71
const avatar = screen . queryByTitle < HTMLImageElement > ( 'Avatar' ) ;
71
72
expect ( avatar ) . not . to . exist ;
72
- expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 0 ) ;
73
73
} ) ;
74
74
75
75
test ( 'Bio must be different' , async ( ) => {
@@ -93,5 +93,5 @@ test('Updating bio produces no failures', async () => {
93
93
94
94
await user . type ( bio , 'Hello' ) ;
95
95
await user . click ( save ) ;
96
- expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . have . length ( 0 ) ;
96
+ expect ( bus . events . filter ( ( e ) => e instanceof DisplayableError ) ) . to . be . empty ;
97
97
} ) ;
0 commit comments