Skip to content

Commit 2c2c109

Browse files
committed
Add empty notification stubs
1 parent e9e55c9 commit 2c2c109

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "notifications",
3+
"count": 0,
4+
"subcount": 0,
5+
"pages": 0,
6+
"resources": [],
7+
"actions": [
8+
{
9+
"name": "mark_as_seen",
10+
"method": "post",
11+
"href": "http://localhost:3000/api/notifications"
12+
},
13+
{
14+
"name": "delete",
15+
"method": "post",
16+
"href": "http://localhost:3000/api/notifications"
17+
}
18+
],
19+
"links": {
20+
"self": "http://localhost:3000/api/notifications?offset=0",
21+
"first": "http://localhost:3000/api/notifications?offset=0",
22+
"last": "http://localhost:3000/api/notifications?offset=0"
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "notifications",
3+
"count": 0,
4+
"subcount": 0,
5+
"pages": 0,
6+
"resources": [],
7+
"actions": [
8+
{
9+
"name": "mark_as_seen",
10+
"method": "post",
11+
"href": "http://localhost:3000/api/notifications"
12+
},
13+
{
14+
"name": "delete",
15+
"method": "post",
16+
"href": "http://localhost:3000/api/notifications"
17+
}
18+
],
19+
"links": {
20+
"self": "http://localhost:3000/api/notifications?expand=resources&attributes=details&sort_by=id&sort_order=desc&limit=100&offset=0",
21+
"first": "http://localhost:3000/api/notifications?expand=resources&attributes=details&sort_by=id&sort_order=desc&limit=100&offset=0",
22+
"last": "http://localhost:3000/api/notifications?expand=resources&attributes=details&sort_by=id&sort_order=desc&limit=100&offset=0"
23+
}
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Cypress.Commands.add('stub_notifications', () => {
2+
cy.intercept('GET', '/api/notifications', (req) => {
3+
req.reply({fixture: 'empty_notifications.json'});
4+
});
5+
6+
cy.intercept('GET', '/api/notifications?expand=resources&attributes=details*', (req) => {
7+
req.reply({fixture: 'empty_notifications_expanded.json'});
8+
});
9+
});

cypress/support/e2e.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import './commands/explorer.js'
4444
import './commands/gtl.js'
4545
import './commands/login.js'
4646
import './commands/menu.js'
47+
import './commands/stub_notifications.js'
4748
import './commands/toolbar.js'
4849
import './commands/throttle_response.js'
4950

@@ -70,4 +71,5 @@ Cypress.on('uncaught:exception', (err, runnable) => {
7071
beforeEach(() => {
7172
// Global hook run once before each test
7273
// cy.throttle_response(500, 56);
74+
// cy.stub_notifications();
7375
})

0 commit comments

Comments
 (0)