20487: Try make tests more reliable
[arvados-workbench2.git] / cypress / integration / project.spec.js
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 describe('Project tests', function() {
6     let activeUser;
7     let adminUser;
8
9     before(function() {
10         // Only set up common users once. These aren't set up as aliases because
11         // aliases are cleaned up after every test. Also it doesn't make sense
12         // to set the same users on beforeEach() over and over again, so we
13         // separate a little from Cypress' 'Best Practices' here.
14         cy.getUser('admin', 'Admin', 'User', true, true)
15             .as('adminUser').then(function() {
16                 adminUser = this.adminUser;
17             }
18         );
19         cy.getUser('user', 'Active', 'User', false, true)
20             .as('activeUser').then(function() {
21                 activeUser = this.activeUser;
22             }
23         );
24     });
25
26     beforeEach(function() {
27         cy.clearCookies();
28         cy.clearLocalStorage();
29     });
30
31     it('creates a new project with multiple properties', function() {
32         const projName = `Test project (${Math.floor(999999 * Math.random())})`;
33         cy.loginAs(activeUser);
34         cy.get('[data-cy=side-panel-button]').click();
35         cy.get('[data-cy=side-panel-new-project]').click();
36         cy.get('[data-cy=form-dialog]')
37             .should('contain', 'New Project')
38             .within(() => {
39                 cy.get('[data-cy=name-field]').within(() => {
40                     cy.get('input').type(projName);
41                 });
42
43             });
44         // Key: Color (IDTAGCOLORS) - Value: Magenta (IDVALCOLORS3)
45         cy.get('[data-cy=form-dialog]').should('not.contain', 'Color: Magenta');
46         cy.get('[data-cy=resource-properties-form]').within(() => {
47             cy.get('[data-cy=property-field-key]').within(() => {
48                 cy.get('input').type('Color');
49             });
50             cy.get('[data-cy=property-field-value]').within(() => {
51                 cy.get('input').type('Magenta');
52             });
53             cy.root().submit();
54             cy.get('[data-cy=property-field-value]').within(() => {
55                 cy.get('input').type('Pink');
56             });
57             cy.root().submit();
58             cy.get('[data-cy=property-field-value]').within(() => {
59                 cy.get('input').type('Yellow');
60             });
61             cy.root().submit();
62         });
63         // Confirm proper vocabulary labels are displayed on the UI.
64         cy.get('[data-cy=form-dialog]').should('contain', 'Color: Magenta');
65         cy.get('[data-cy=form-dialog]').should('contain', 'Color: Pink');
66         cy.get('[data-cy=form-dialog]').should('contain', 'Color: Yellow');
67
68         cy.get('[data-cy=resource-properties-form]').within(() => {
69             cy.get('[data-cy=property-field-key]').within(() => {
70                 cy.get('input').focus();
71             });
72             cy.get('[data-cy=property-field-key]').should('not.contain', 'Color');
73         });
74
75         // Create project and confirm the properties' real values.
76         cy.get('[data-cy=form-submit-btn]').click();
77         cy.get('[data-cy=breadcrumb-last]').should('contain', projName);
78         cy.doRequest('GET', '/arvados/v1/groups', null, {
79             filters: `[["name", "=", "${projName}"], ["group_class", "=", "project"]]`,
80         })
81         .its('body.items').as('projects')
82         .then(function() {
83             expect(this.projects).to.have.lengthOf(1);
84             expect(this.projects[0].properties).to.deep.equal(
85                 // Pink is not in the test vocab
86                 {IDTAGCOLORS: ['IDVALCOLORS3', 'Pink', 'IDVALCOLORS1']});
87         });
88
89         // Open project edit via breadcrumbs
90         cy.get('[data-cy=breadcrumbs]').contains(projName).rightclick();
91         cy.get('[data-cy=context-menu]').contains('Edit').click();
92         cy.get('[data-cy=form-dialog]').within(() => {
93             cy.get('[data-cy=resource-properties-list]').within(() => {
94                 cy.get('div[role=button]').contains('Color: Magenta');
95                 cy.get('div[role=button]').contains('Color: Pink');
96                 cy.get('div[role=button]').contains('Color: Yellow');
97             });
98         });
99         // Add another property
100         cy.get('[data-cy=resource-properties-form]').within(() => {
101             cy.get('[data-cy=property-field-key]').within(() => {
102                 cy.get('input').type('Animal');
103             });
104             cy.get('[data-cy=property-field-value]').within(() => {
105                 cy.get('input').type('Dog');
106             });
107             cy.root().submit();
108         });
109         cy.get('[data-cy=form-submit-btn]').click();
110         // Reopen edit via breadcrumbs and verify properties
111         cy.get('[data-cy=breadcrumbs]').contains(projName).rightclick();
112         cy.get('[data-cy=context-menu]').contains('Edit').click();
113         cy.get('[data-cy=form-dialog]').within(() => {
114             cy.get('[data-cy=resource-properties-list]').within(() => {
115                 cy.get('div[role=button]').contains('Color: Magenta');
116                 cy.get('div[role=button]').contains('Color: Pink');
117                 cy.get('div[role=button]').contains('Color: Yellow');
118                 cy.get('div[role=button]').contains('Animal: Dog');
119             });
120         });
121     });
122
123     it('creates a project without and with description', function() {
124         const projName = `Test project (${Math.floor(999999 * Math.random())})`;
125         cy.loginAs(activeUser);
126
127         // Create project
128         cy.get('[data-cy=side-panel-button]').click();
129         cy.get('[data-cy=side-panel-new-project]').click();
130         cy.get('[data-cy=form-dialog]')
131             .should('contain', 'New Project')
132             .within(() => {
133                 cy.get('[data-cy=name-field]').within(() => {
134                     cy.get('input').type(projName);
135                 });
136             });
137         cy.get('[data-cy=form-submit-btn]').click();
138         cy.get('[data-cy=form-dialog]').should('not.exist');
139
140         const editProjectDescription = (name, type) => {
141             cy.get('[data-cy=side-panel-tree]').contains('Home Projects').click();
142             cy.get('[data-cy=project-panel] tbody tr').contains(name).rightclick();
143             cy.get('[data-cy=context-menu]').contains('Edit').click();
144             cy.get('[data-cy=form-dialog]').within(() => {
145                 cy.get('div[contenteditable=true]')
146                     .click()
147                     .type(type);
148                 cy.get('[data-cy=form-submit-btn]').click();
149             });
150         };
151
152         const verifyProjectDescription = (name, description) => {
153             cy.doRequest('GET', '/arvados/v1/groups', null, {
154                 filters: `[["name", "=", "${name}"], ["group_class", "=", "project"]]`,
155             })
156             .its('body.items').as('projects')
157             .then(function() {
158                 expect(this.projects).to.have.lengthOf(1);
159                 expect(this.projects[0].description).to.equal(description);
160             });
161         };
162
163         // Edit description
164         editProjectDescription(projName, 'Test description');
165
166         // Check description is set
167         verifyProjectDescription(projName, "<p>Test description</p>");
168
169         // Clear description
170         editProjectDescription(projName, '{selectall}{backspace}');
171
172         // Check description is null
173         verifyProjectDescription(projName, null);
174
175         // Set description to contain whitespace
176         editProjectDescription(projName, '{selectall}{backspace}    x');
177         editProjectDescription(projName, '{backspace}');
178
179         // Check description is null
180         verifyProjectDescription(projName, null);
181
182     });
183
184     it('creates new project on home project and then a subproject inside it', function() {
185         const createProject = function(name, parentName) {
186             cy.get('[data-cy=side-panel-button]').click();
187             cy.get('[data-cy=side-panel-new-project]').click();
188             cy.get('[data-cy=form-dialog]')
189                 .should('contain', 'New Project')
190                 .within(() => {
191                     cy.get('[data-cy=parent-field]').within(() => {
192                         cy.get('input').invoke('val').then((val) => {
193                             expect(val).to.include(parentName);
194                         });
195                     });
196                     cy.get('[data-cy=name-field]').within(() => {
197                         cy.get('input').type(name);
198                     });
199                 });
200             cy.get('[data-cy=form-submit-btn]').click();
201         }
202
203         cy.loginAs(activeUser);
204         cy.goToPath(`/projects/${activeUser.user.uuid}`);
205         cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
206         cy.get('[data-cy=breadcrumb-last]').should('not.exist');
207         // Create new project
208         const projName = `Test project (${Math.floor(999999 * Math.random())})`;
209         createProject(projName, 'Home project');
210         // Confirm that the user was taken to the newly created thing
211         cy.get('[data-cy=form-dialog]').should('not.exist');
212         cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
213         cy.get('[data-cy=breadcrumb-last]').should('contain', projName);
214         // Create a subproject
215         const subProjName = `Test project (${Math.floor(999999 * Math.random())})`;
216         createProject(subProjName, projName);
217         cy.get('[data-cy=form-dialog]').should('not.exist');
218         cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
219         cy.get('[data-cy=breadcrumb-last]').should('contain', subProjName);
220     });
221
222     it('attempts to use a preexisting name creating a project', function() {
223         const name = `Test project ${Math.floor(Math.random() * 999999)}`;
224         cy.createGroup(activeUser.token, {
225             name: name,
226             group_class: 'project',
227         });
228         cy.loginAs(activeUser);
229         cy.goToPath(`/projects/${activeUser.user.uuid}`);
230
231         // Attempt to create new collection with a duplicate name
232         cy.get('[data-cy=side-panel-button]').click();
233         cy.get('[data-cy=side-panel-new-project]').click();
234         cy.get('[data-cy=form-dialog]')
235             .should('contain', 'New Project')
236             .within(() => {
237                 cy.get('[data-cy=name-field]').within(() => {
238                     cy.get('input').type(name);
239                 });
240                 cy.get('[data-cy=form-submit-btn]').click();
241             });
242         // Error message should display, allowing editing the name
243         cy.get('[data-cy=form-dialog]').should('exist')
244             .and('contain', 'Project with the same name already exists')
245             .within(() => {
246                 cy.get('[data-cy=name-field]').within(() => {
247                     cy.get('input').type(' renamed');
248                 });
249                 cy.get('[data-cy=form-submit-btn]').click();
250             });
251         cy.get('[data-cy=form-dialog]').should('not.exist');
252     });
253
254     it('navigates to the parent project after trashing the one being displayed', function() {
255         cy.createGroup(activeUser.token, {
256             name: `Test root project ${Math.floor(Math.random() * 999999)}`,
257             group_class: 'project',
258         }).as('testRootProject').then(function() {
259             cy.createGroup(activeUser.token, {
260                 name : `Test subproject ${Math.floor(Math.random() * 999999)}`,
261                 group_class: 'project',
262                 owner_uuid: this.testRootProject.uuid,
263             }).as('testSubProject');
264         });
265         cy.getAll('@testRootProject', '@testSubProject').then(function([testRootProject, testSubProject]) {
266             cy.loginAs(activeUser);
267
268             // Go to subproject and trash it.
269             cy.goToPath(`/projects/${testSubProject.uuid}`);
270             cy.get('[data-cy=side-panel-tree]').should('contain', testSubProject.name);
271             cy.get('[data-cy=breadcrumb-last]')
272                 .should('contain', testSubProject.name)
273                 .rightclick();
274             cy.get('[data-cy=context-menu]').contains('Move to trash').click();
275
276             // Confirm that the parent project should be displayed.
277             cy.get('[data-cy=breadcrumb-last]').should('contain', testRootProject.name);
278             cy.url().should('contain', `/projects/${testRootProject.uuid}`);
279             cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubProject.name);
280
281             // Checks for bugfix #17637.
282             cy.get('[data-cy=not-found-content]').should('not.exist');
283             cy.get('[data-cy=not-found-page]').should('not.exist');
284         });
285     });
286
287     it('resets the search box only when navigating out of the current project', function() {
288         const fooProjectNameA = `Test foo project ${Math.floor(Math.random() * 999999)}`;
289         const fooProjectNameB = `Test foo project ${Math.floor(Math.random() * 999999)}`;
290         const barProjectNameA = `Test bar project ${Math.floor(Math.random() * 999999)}`;
291
292         [fooProjectNameA, fooProjectNameB, barProjectNameA].forEach(projName => {
293             cy.createGroup(activeUser.token, {
294                 name: projName,
295                 group_class: 'project',
296             });
297         });
298
299         cy.loginAs(activeUser);
300         cy.get('[data-cy=project-panel]')
301             .should('contain', fooProjectNameA)
302             .and('contain', fooProjectNameB)
303             .and('contain', barProjectNameA);
304
305         cy.get('[data-cy=search-input]').type('foo');
306         cy.get('[data-cy=project-panel]')
307             .should('contain', fooProjectNameA)
308             .and('contain', fooProjectNameB)
309             .and('not.contain', barProjectNameA);
310
311         // Click on the table row to select it, search should remain the same.
312         cy.get(`p:contains(${fooProjectNameA})`)
313             .parent().parent().parent().parent().click();
314         cy.get('[data-cy=search-input] input').should('have.value', 'foo');
315
316         // Click to navigate to the project, search should be reset
317         cy.get(`p:contains(${fooProjectNameA})`).click();
318         cy.get('[data-cy=search-input] input').should('not.have.value', 'foo');
319     });
320
321     it('navigates to the root project after trashing the parent of the one being displayed', function() {
322         cy.createGroup(activeUser.token, {
323             name: `Test root project ${Math.floor(Math.random() * 999999)}`,
324             group_class: 'project',
325         }).as('testRootProject').then(function() {
326             cy.createGroup(activeUser.token, {
327                 name : `Test subproject ${Math.floor(Math.random() * 999999)}`,
328                 group_class: 'project',
329                 owner_uuid: this.testRootProject.uuid,
330             }).as('testSubProject').then(function() {
331                 cy.createGroup(activeUser.token, {
332                     name : `Test sub subproject ${Math.floor(Math.random() * 999999)}`,
333                     group_class: 'project',
334                     owner_uuid: this.testSubProject.uuid,
335                 }).as('testSubSubProject');
336             });
337         });
338         cy.getAll('@testRootProject', '@testSubProject', '@testSubSubProject').then(function([testRootProject, testSubProject, testSubSubProject]) {
339             cy.loginAs(activeUser);
340
341             // Go to innermost project and trash its parent.
342             cy.goToPath(`/projects/${testSubSubProject.uuid}`);
343             cy.get('[data-cy=side-panel-tree]').should('contain', testSubSubProject.name);
344             cy.get('[data-cy=breadcrumb-last]').should('contain', testSubSubProject.name);
345             cy.get('[data-cy=side-panel-tree]')
346                 .contains(testSubProject.name)
347                 .rightclick();
348             cy.get('[data-cy=context-menu]').contains('Move to trash').click();
349
350             // Confirm that the trashed project's parent should be displayed.
351             cy.get('[data-cy=breadcrumb-last]').should('contain', testRootProject.name);
352             cy.url().should('contain', `/projects/${testRootProject.uuid}`);
353             cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubProject.name);
354             cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubSubProject.name);
355
356             // Checks for bugfix #17637.
357             cy.get('[data-cy=not-found-content]').should('not.exist');
358             cy.get('[data-cy=not-found-page]').should('not.exist');
359         });
360     });
361
362     it('shows details panel when clicking on the info icon', () => {
363         cy.createGroup(activeUser.token, {
364             name: `Test root project ${Math.floor(Math.random() * 999999)}`,
365             group_class: 'project',
366         }).as('testRootProject').then(function(testRootProject) {
367             cy.loginAs(activeUser);
368
369             cy.get('[data-cy=side-panel-tree]').contains(testRootProject.name).click();
370
371             cy.get('[data-cy=additional-info-icon]').click();
372
373             cy.contains(testRootProject.uuid).should('exist');
374         });
375     });
376
377     it('clears search input when changing project', () => {
378         cy.createGroup(activeUser.token, {
379             name: `Test root project ${Math.floor(Math.random() * 999999)}`,
380             group_class: 'project',
381         }).as('testProject1').then((testProject1) => {
382             cy.shareWith(adminUser.token, activeUser.user.uuid, testProject1.uuid, 'can_write');
383         });
384
385         cy.getAll('@testProject1').then(function([testProject1]) {
386             cy.loginAs(activeUser);
387
388             cy.get('[data-cy=side-panel-tree]').contains(testProject1.name).click();
389
390             cy.get('[data-cy=search-input] input').type('test123');
391
392             cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
393
394             cy.get('[data-cy=search-input] input').should('not.have.value', 'test123');
395         });
396     });
397
398     it('opens advanced popup for project with username', () => {
399         const projectName = `Test project ${Math.floor(Math.random() * 999999)}`;
400
401         cy.createGroup(adminUser.token, {
402             name: projectName,
403             group_class: 'project',
404         }).as('mainProject')
405
406         cy.getAll('@mainProject')
407             .then(function ([mainProject]) {
408                 cy.loginAs(adminUser);
409
410                 cy.get('[data-cy=side-panel-tree]').contains('Groups').click();
411
412                 cy.get('[data-cy=uuid]').eq(0).invoke('text').then(uuid => {
413                     cy.createLink(adminUser.token, {
414                         name: 'can_write',
415                         link_class: 'permission',
416                         head_uuid: mainProject.uuid,
417                         tail_uuid: uuid
418                     });
419
420                     cy.createLink(adminUser.token, {
421                         name: 'can_write',
422                         link_class: 'permission',
423                         head_uuid: mainProject.uuid,
424                         tail_uuid: activeUser.user.uuid
425                     });
426
427                     cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
428
429                     cy.get('main').contains(projectName).rightclick();
430
431                     cy.get('[data-cy=context-menu]').contains('API Details').click();
432
433                     cy.get('[role=tablist]').contains('METADATA').click();
434
435                     cy.get('td').contains(uuid).should('exist');
436
437                     cy.get('td').contains(activeUser.user.uuid).should('exist');
438                 });
439         });
440     });
441
442     describe('Frozen projects', () => {
443         beforeEach(() => {
444             cy.createGroup(activeUser.token, {
445                 name: `Main project ${Math.floor(Math.random() * 999999)}`,
446                 group_class: 'project',
447             }).as('mainProject');
448
449             cy.createGroup(adminUser.token, {
450                 name: `Admin project ${Math.floor(Math.random() * 999999)}`,
451                 group_class: 'project',
452             }).as('adminProject').then((mainProject) => {
453                 cy.shareWith(adminUser.token, activeUser.user.uuid, mainProject.uuid, 'can_write');
454             });
455
456             cy.get('@mainProject').then((mainProject) => {
457                 cy.createGroup(adminUser.token, {
458                     name : `Sub project ${Math.floor(Math.random() * 999999)}`,
459                     group_class: 'project',
460                     owner_uuid: mainProject.uuid,
461                 }).as('subProject');
462
463                 cy.createCollection(adminUser.token, {
464                     name: `Main collection ${Math.floor(Math.random() * 999999)}`,
465                     owner_uuid: mainProject.uuid,
466                     manifest_text: "./subdir 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo\n. 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
467                 }).as('mainCollection');
468             });
469         });
470
471         it('should be able to froze own project', () => {
472             cy.getAll('@mainProject').then(([mainProject]) => {
473                 cy.loginAs(activeUser);
474
475                 cy.get('[data-cy=project-panel]').contains(mainProject.name).rightclick();
476
477                 cy.get('[data-cy=context-menu]').contains('Freeze').click();
478
479                 cy.get('[data-cy=project-panel]').contains(mainProject.name).rightclick();
480
481                 cy.get('[data-cy=context-menu]').contains('Freeze').should('not.exist');
482             });
483         });
484
485         it('should not be able to modify items within the frozen project', () => {
486             cy.getAll('@mainProject', '@mainCollection').then(([mainProject, mainCollection]) => {
487                 cy.loginAs(activeUser);
488
489                 cy.get('[data-cy=project-panel]').contains(mainProject.name).rightclick();
490
491                 cy.get('[data-cy=context-menu]').contains('Freeze').click();
492
493                 cy.get('[data-cy=project-panel]').contains(mainProject.name).click();
494
495                 cy.get('[data-cy=project-panel]').contains(mainCollection.name).rightclick();
496
497                 cy.get('[data-cy=context-menu]').contains('Move to trash').should('not.exist');
498             });
499         });
500
501         it('should be able to froze not owned project', () => {
502             cy.getAll('@adminProject').then(([adminProject]) => {
503                 cy.loginAs(activeUser);
504
505                 cy.get('[data-cy=side-panel-tree]').contains('Shared with me').click();
506
507                 cy.get('main').contains(adminProject.name).rightclick();
508
509                 cy.get('[data-cy=context-menu]').contains('Freeze').should('not.exist');
510             });
511         });
512
513         it('should be able to unfroze project if user is an admin', () => {
514             cy.getAll('@adminProject').then(([adminProject]) => {
515                 cy.loginAs(adminUser);
516
517                 cy.get('main').contains(adminProject.name).rightclick();
518
519                 cy.get('[data-cy=context-menu]').contains('Freeze').click();
520
521                 cy.wait(1000);
522
523                 cy.get('main').contains(adminProject.name).rightclick();
524
525                 cy.get('[data-cy=context-menu]').contains('Unfreeze').click();
526
527                 cy.get('main').contains(adminProject.name).rightclick();
528
529                 cy.get('[data-cy=context-menu]').contains('Freeze').should('exist');
530             });
531         });
532     });
533
534     it('copies project URL to clipboard', () => {
535         const projectName = `Test project (${Math.floor(999999 * Math.random())})`;
536
537         cy.loginAs(activeUser);
538         cy.get('[data-cy=side-panel-button]').click();
539         cy.get('[data-cy=side-panel-new-project]').click();
540         cy.get('[data-cy=form-dialog]')
541             .should('contain', 'New Project')
542             .within(() => {
543                 cy.get('[data-cy=name-field]').within(() => {
544                     cy.get('input').type(projectName);
545                 });
546                 cy.get('[data-cy=form-submit-btn]').click();
547             });
548         cy.get('[data-cy=form-dialog]').should("not.exist");
549         cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
550         cy.waitForDom();
551         cy.get('[data-cy=project-panel]').contains(projectName).should('be.visible').rightclick();
552         cy.get('[data-cy=context-menu]').contains('Copy to clipboard').click();
553         cy.window().then((win) => (
554             win.navigator.clipboard.readText().then((text) => {
555                 expect(text).to.match(/https\:\/\/localhost\:[0-9]+\/projects\/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/,);
556             })
557         ));
558
559     });
560
561     it('sorts displayed items correctly', () => {
562         cy.loginAs(activeUser);
563
564         cy.get('[data-cy=project-panel] button[title="Select columns"]').click();
565         cy.get('div[role=presentation] ul > div[role=button]').contains('Date Created').click();
566         cy.get('div[role=presentation] ul > div[role=button]').contains('Trash at').click();
567         cy.get('div[role=presentation] ul > div[role=button]').contains('Delete at').click();
568         cy.get('div[role=presentation] > div[aria-hidden=true]').click();
569
570         cy.intercept({method: 'GET', url: '**/arvados/v1/groups/*/contents*'}).as('filteredQuery');
571         [
572             {
573                 name: "Name",
574                 asc: "collections.name asc,container_requests.name asc,groups.name asc",
575                 desc: "collections.name desc,container_requests.name desc,groups.name desc"
576             },
577             {
578                 name: "Last Modified",
579                 asc: "collections.modified_at asc,container_requests.modified_at asc,groups.modified_at asc",
580                 desc: "collections.modified_at desc,container_requests.modified_at desc,groups.modified_at desc"
581             },
582             {
583                 name: "Date Created",
584                 asc: "collections.created_at asc,container_requests.created_at asc,groups.created_at asc",
585                 desc: "collections.created_at desc,container_requests.created_at desc,groups.created_at desc"
586
587             },
588             {
589                 name: "Trash at",
590                 asc: "collections.trash_at asc,container_requests.trash_at asc,groups.trash_at asc",
591                 desc: "collections.trash_at desc,container_requests.trash_at desc,groups.trash_at desc"
592
593             },
594             {
595                 name: "Delete at",
596                 asc: "collections.delete_at asc,container_requests.delete_at asc,groups.delete_at asc",
597                 desc: "collections.delete_at desc,container_requests.delete_at desc,groups.delete_at desc"
598
599             },
600         ].forEach((test) => {
601             cy.get('[data-cy=project-panel] table thead th').contains(test.name).click();
602             cy.wait('@filteredQuery').then(interception => {
603                 const searchParams = new URLSearchParams((new URL(interception.request.url).search));
604                 expect(searchParams.get('order')).to.eq(test.asc);
605             });
606             cy.get('[data-cy=project-panel] table thead th').contains(test.name).click();
607             cy.wait('@filteredQuery').then(interception => {
608                 const searchParams = new URLSearchParams((new URL(interception.request.url).search));
609                 expect(searchParams.get('order')).to.eq(test.desc);
610             });
611         });
612
613     });
614 });