18549: Layout fixed, tests updated
[arvados-workbench2.git] / cypress / integration / page-not-found.spec.js
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 describe('Page not found tests', function() {
6     let adminUser;
7
8     before(function() {
9         cy.getUser('admin', 'Admin', 'User', true, true)
10             .as('adminUser').then(function() {
11                 adminUser = this.adminUser;
12             }
13         );
14     });
15
16     beforeEach(function() {
17         cy.clearCookies()
18         cy.clearLocalStorage()
19     });
20
21     it('shows not found page', function() {
22         // when
23         cy.loginAs(adminUser);
24         cy.goToPath(`/this/is/an/invalid/route`);
25
26         // then
27         cy.get('[data-cy=not-found-page]').should('exist');
28         cy.get('[data-cy=not-found-content]').should('exist');
29     });
30
31
32     it('shows not found popup', function() {
33         // given
34         const notExistingUUID = 'zzzzz-tpzed-5o5tg0l9a57gxxx';
35
36         // when
37         cy.loginAs(adminUser);
38         cy.goToPath(`/projects/${notExistingUUID}`);
39
40         // then
41         cy.get('[data-cy=not-found-content]').should('exist');
42         cy.get('[data-cy=not-found-page]').should('not.exist');
43     });
44 })