Skip to content

Commit 4b08954

Browse files
author
Emmanouil Konstantinidis
committed
Test that the error message will show up
1 parent 8606292 commit 4b08954

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/js/__tests__/components/notifications.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ describe('Test for Notifications Component', function () {
7070
expect(instance.state.loading).toBeTruthy();
7171
instance.completedNotifications();
7272
expect(instance.state.loading).toBeFalsy();
73+
expect(instance.state.errors).toBeFalsy();
74+
75+
var errors = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'errored');
76+
expect(errors.length).toBe(0);
77+
78+
instance.failedNotifications();
79+
expect(instance.state.loading).toBeFalsy();
80+
expect(instance.state.errors).toBeTruthy();
81+
82+
errors = TestUtils.scryRenderedDOMComponentsWithClass(instance, 'errored');
83+
expect(errors.length).toBe(1);
7384

7485
});
7586

0 commit comments

Comments
 (0)