1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 describe("Project tests", 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)
17 adminUser = this.adminUser;
19 cy.getUser("user", "Active", "User", false, true)
22 activeUser = this.activeUser;
26 it("creates a new project with multiple properties", function () {
27 const projName = `Test project (${Math.floor(999999 * Math.random())})`;
28 cy.loginAs(activeUser);
29 cy.get("[data-cy=side-panel-button]").click();
30 cy.get("[data-cy=side-panel-new-project]").click();
31 cy.get("[data-cy=form-dialog]")
32 .should("contain", "New Project")
34 cy.get("[data-cy=name-field]").within(() => {
35 cy.get("input").type(projName);
38 // Key: Color (IDTAGCOLORS) - Value: Magenta (IDVALCOLORS3)
39 cy.get("[data-cy=form-dialog]").should("not.contain", "Color: Magenta");
40 cy.get("[data-cy=resource-properties-form]").within(() => {
41 cy.get("[data-cy=property-field-key]").within(() => {
42 cy.get("input").type("Color").blur();
44 cy.get("[data-cy=property-field-value]").within(() => {
45 cy.get("input").type("Magenta").blur();
47 cy.get("[data-cy=property-add-btn]").click();
49 cy.get("[data-cy=property-field-value]").within(() => {
50 cy.get("input").type("Pink").blur();
52 cy.get("[data-cy=property-add-btn]").click();
54 cy.get("[data-cy=property-field-value]").within(() => {
55 cy.get("input").type("Yellow").blur();
57 cy.get("[data-cy=property-add-btn]").click();
59 // Confirm proper vocabulary labels are displayed on the UI.
60 cy.get("[data-cy=form-dialog]").should("contain", "Color: Magenta");
61 cy.get("[data-cy=form-dialog]").should("contain", "Color: Pink");
62 cy.get("[data-cy=form-dialog]").should("contain", "Color: Yellow");
64 cy.get("[data-cy=resource-properties-form]").within(() => {
65 cy.get("[data-cy=property-field-key]").within(() => {
66 cy.get("input").focus();
68 cy.get("[data-cy=property-field-key]").should("not.contain", "Color");
71 // Create project and confirm the properties' real values.
72 cy.get("[data-cy=form-submit-btn]").click();
74 cy.get("[data-cy=form-dialog]").should("not.exist");
76 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
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"]]`,
84 expect(this.projects).to.have.lengthOf(1);
85 expect(this.projects[0].properties).to.deep.equal(
86 // Pink is not in the test vocab
87 { IDTAGCOLORS: ["IDVALCOLORS3", "Pink", "IDVALCOLORS1"] }
91 // Open project edit via breadcrumbs
92 cy.get("[data-cy=breadcrumbs]").contains(projName).rightclick();
93 cy.get("[data-cy=context-menu]").contains("Edit").click();
94 cy.get("[data-cy=form-dialog]").within(() => {
95 cy.get("[data-cy=resource-properties-list]").within(() => {
96 cy.get("div[role=button]").contains("Color: Magenta");
97 cy.get("div[role=button]").contains("Color: Pink");
98 cy.get("div[role=button]").contains("Color: Yellow");
101 // Add another property
102 cy.get("[data-cy=resource-properties-form]").within(() => {
103 cy.get("[data-cy=property-field-key]").within(() => {
104 cy.get("input").type("Medium").blur();
106 cy.get("[data-cy=property-field-value]").within(() => {
107 cy.get("input").type("Egg").blur();
109 cy.get("[data-cy=property-add-btn]").click();
111 cy.get("[data-cy=form-submit-btn]").click();
112 // Reopen edit via breadcrumbs and verify properties
113 cy.get("[data-cy=breadcrumbs]").contains(projName).rightclick();
114 cy.get("[data-cy=context-menu]").contains("Edit").click();
115 cy.get("[data-cy=form-dialog]").within(() => {
116 cy.get("[data-cy=resource-properties-list]").within(() => {
117 cy.get("div[role=button]").contains("Color: Magenta");
118 cy.get("div[role=button]").contains("Color: Pink");
119 cy.get("div[role=button]").contains("Color: Yellow");
120 cy.get("div[role=button]").contains("Medium: Egg");
125 it("creates a project without and with description", function () {
126 const projName = `Test project (${Math.floor(999999 * Math.random())})`;
127 cy.loginAs(activeUser);
130 cy.get("[data-cy=side-panel-button]").click();
131 cy.get("[data-cy=side-panel-new-project]").click();
132 cy.get("[data-cy=form-dialog]")
133 .should("contain", "New Project")
135 cy.get("[data-cy=name-field]").within(() => {
136 cy.get("input").type(projName);
139 cy.get("[data-cy=form-submit-btn]").click();
141 cy.get("[data-cy=form-dialog]").should("not.exist");
143 const editProjectDescription = (name, type) => {
144 cy.get("[data-cy=side-panel-tree]").contains("Home Projects").click();
145 cy.get("[data-cy=project-panel] tbody").contains(name).rightclick({ force: true });
146 cy.get("[data-cy=context-menu]").contains("Edit").click();
147 cy.get("[data-cy=form-dialog]").within(() => {
148 cy.get("div[contenteditable=true]").click().type(type);
149 cy.get("[data-cy=form-submit-btn]").click();
153 const verifyProjectDescription = (name, description) => {
154 cy.doRequest("GET", "/arvados/v1/groups", null, {
155 filters: `[["name", "=", "${name}"], ["group_class", "=", "project"]]`,
160 expect(this.projects).to.have.lengthOf(1);
161 expect(this.projects[0].description).to.equal(description);
166 editProjectDescription(projName, "Test description");
168 // Check description is set
169 verifyProjectDescription(projName, "<p>Test description</p>");
172 editProjectDescription(projName, "{selectall}{backspace}");
174 // Check description is null
175 verifyProjectDescription(projName, null);
177 // Set description to contain whitespace
178 editProjectDescription(projName, "{selectall}{backspace} x");
179 editProjectDescription(projName, "{backspace}");
181 // Check description is null
182 verifyProjectDescription(projName, null);
185 it("creates a project from the context menu in the correct subfolder", function () {
186 const parentProjName = `Test project (${Math.floor(999999 * Math.random())})`;
187 const childProjName = `Test project (${Math.floor(999999 * Math.random())})`;
188 cy.loginAs(activeUser);
191 cy.get("[data-cy=side-panel-button]").click();
192 cy.get("[data-cy=side-panel-new-project]").click();
193 cy.get("[data-cy=form-dialog]")
194 .should("contain", "New Project")
196 cy.get("[data-cy=name-field]").within(() => {
197 cy.get("input").type(parentProjName);
200 cy.get("[data-cy=form-submit-btn]").click();
202 cy.get("[data-cy=form-dialog]").should("not.exist");
203 cy.get("button").contains('Home Projects').click();
206 // Create subproject from context menu
207 cy.get("[data-cy=project-panel]").should('exist', { timeout: 10000 });
208 cy.get("[data-cy=project-panel]").contains(parentProjName).should('exist').parents('td').rightclick();
209 cy.get("[data-cy=context-menu]").contains("New project").click();
210 cy.get("[data-cy=form-dialog]")
211 .should("contain", "New Project")
213 cy.get("[data-cy=name-field]").within(() => {
214 cy.get("input").type(childProjName);
217 cy.get("[data-cy=form-submit-btn]").click();
219 cy.get("[data-cy=form-dialog]").should("not.exist");
221 // open details panel and check 'owner' field
222 cy.get('[data-cy=multiselect-button]').eq(0).trigger('mouseover');
223 cy.get('body').contains('View details').should('exist')
224 cy.get('[data-cy=multiselect-button]').eq(0).click();
227 cy.get("[data-cy=details-panel-owner]").contains(parentProjName).should("be.visible")
228 cy.get("[data-cy=close-details-btn]").click();
231 it('shows the appropriate buttons in the multiselect toolbar', () => {
233 const msButtonTooltips = [
236 'Copy link to clipboard',
237 'Open with 3rd party client',
248 cy.loginAs(activeUser);
249 const projName = `Test project (${Math.floor(999999 * Math.random())})`;
250 cy.get('[data-cy=side-panel-button]').click();
251 cy.get('[data-cy=side-panel-new-project]').click();
252 cy.get('[data-cy=form-dialog]')
253 .should('contain', 'New Project')
255 cy.get('[data-cy=name-field]').within(() => {
256 cy.get('input').type(projName);
259 cy.get("[data-cy=form-submit-btn]").click();
263 cy.get('[data-cy=data-table-row]').contains(projName).should('exist').parents('td').click()
265 cy.get('[data-cy=multiselect-button]').should('have.length', msButtonTooltips.length)
266 for (let i = 0; i < msButtonTooltips.length; i++) {
267 cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseover');
269 cy.get('body').contains(msButtonTooltips[i]).should('exist')
270 cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseout');
274 it("creates new project on home project and then a subproject inside it", function () {
275 const createProject = function (name, parentName) {
276 cy.get("[data-cy=side-panel-button]").click();
277 cy.get("[data-cy=side-panel-new-project]").click();
278 cy.get("[data-cy=form-dialog]")
279 .should("contain", "New Project")
281 cy.get("[data-cy=parent-field]").within(() => {
285 expect(val).to.include(parentName);
288 cy.get("[data-cy=name-field]").within(() => {
289 cy.get("input").type(name);
292 cy.get("[data-cy=form-submit-btn]").click();
296 cy.loginAs(activeUser);
297 cy.goToPath(`/projects/${activeUser.user.uuid}`);
298 cy.get("[data-cy=breadcrumb-first]").should('exist');
299 cy.get("[data-cy=breadcrumb-first]").should("contain", "Projects");
300 cy.get("[data-cy=breadcrumb-last]").should("not.exist");
301 // Create new project
302 const projName = `Test project (${Math.floor(999999 * Math.random())})`;
303 createProject(projName, "Home project");
304 // Confirm that the user was taken to the newly created thing
305 cy.get("[data-cy=form-dialog]").should("not.exist");
306 cy.get("[data-cy=breadcrumb-first]").should("contain", "Projects");
308 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
309 cy.get("[data-cy=breadcrumb-last]").should("contain", projName);
310 // Create a subproject
311 const subProjName = `Test project (${Math.floor(999999 * Math.random())})`;
312 createProject(subProjName, projName);
313 cy.get("[data-cy=form-dialog]").should("not.exist");
314 cy.get("[data-cy=breadcrumb-first]").should("contain", "Projects");
316 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
317 cy.get("[data-cy=breadcrumb-last]").should("contain", subProjName); //here
320 it("attempts to use a preexisting name creating a project", function () {
321 const name = `Test project ${Math.floor(Math.random() * 999999)}`;
322 cy.createGroup(activeUser.token, {
324 group_class: "project",
326 cy.loginAs(activeUser);
327 cy.goToPath(`/projects/${activeUser.user.uuid}`);
329 // Attempt to create new collection with a duplicate name
330 cy.get("[data-cy=side-panel-button]").click();
331 cy.get("[data-cy=side-panel-new-project]").click();
332 cy.get("[data-cy=form-dialog]")
333 .should("contain", "New Project")
335 cy.get("[data-cy=name-field]").within(() => {
336 cy.get("input").type(name);
338 cy.get("[data-cy=form-submit-btn]").click();
340 // Error message should display, allowing editing the name
341 cy.get("[data-cy=form-dialog]")
342 .should("exist") //here
343 .and("contain", "Project with the same name already exists")
345 cy.get("[data-cy=name-field]").within(() => {
346 cy.get("input").type(" renamed");
348 cy.get("[data-cy=form-submit-btn]").click();
351 cy.get("[data-cy=form-dialog]").should("not.exist");
354 it("navigates to the parent project after trashing the one being displayed", function () {
355 cy.createGroup(activeUser.token, {
356 name: `Test root project ${Math.floor(Math.random() * 999999)}`,
357 group_class: "project",
359 .as("testRootProject")
361 cy.createGroup(activeUser.token, {
362 name: `Test subproject ${Math.floor(Math.random() * 999999)}`,
363 group_class: "project",
364 owner_uuid: this.testRootProject.uuid,
365 }).as("testSubProject");
367 cy.getAll("@testRootProject", "@testSubProject").then(function ([testRootProject, testSubProject]) {
368 cy.loginAs(activeUser);
370 // Go to subproject and trash it.
371 cy.goToPath(`/projects/${testSubProject.uuid}`);
372 cy.get("[data-cy=side-panel-tree]").should('exist');
373 cy.get("[data-cy=side-panel-tree]").should("contain", testSubProject.name);
375 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
376 cy.get("[data-cy=breadcrumb-last]").should("contain", testSubProject.name).rightclick();
377 cy.get("[data-cy=context-menu]").contains("Move to trash").click();
379 // Confirm that the parent project should be displayed.
381 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
382 cy.get("[data-cy=breadcrumb-last]").should("contain", testRootProject.name);
383 cy.url().should("contain", `/projects/${testRootProject.uuid}`);
384 cy.get("[data-cy=side-panel-tree]").should("not.contain", testSubProject.name);
386 // Checks for bugfix #17637.
387 cy.get("[data-cy=not-found-content]").should("not.exist");
388 cy.get("[data-cy=not-found-page]").should("not.exist");
392 it("resets the search box only when navigating out of the current project", function () {
393 const fooProjectNameA = `Test foo project ${Math.floor(Math.random() * 999999)}`;
394 const fooProjectNameB = `Test foo project ${Math.floor(Math.random() * 999999)}`;
395 const barProjectNameA = `Test bar project ${Math.floor(Math.random() * 999999)}`;
397 [fooProjectNameA, fooProjectNameB, barProjectNameA].forEach(projName => {
398 cy.createGroup(activeUser.token, {
400 group_class: "project",
404 cy.loginAs(activeUser);
405 cy.get("[data-cy=project-panel]").should("contain", fooProjectNameA).and("contain", fooProjectNameB).and("contain", barProjectNameA);
407 cy.get("[data-cy=search-input]").type("foo");
408 cy.get("[data-cy=project-panel]").should("contain", fooProjectNameA).and("contain", fooProjectNameB).and("not.contain", barProjectNameA);
410 // Click on the table row to select it, search should remain the same.
411 cy.get(`p:contains(${fooProjectNameA})`).should('exist').parents('td').click()
412 cy.get("[data-cy=search-input] input").should("have.value", "foo");
414 // Click to navigate to the project, search should be reset
415 cy.get(`p:contains(${fooProjectNameA})`).click();
416 cy.get("[data-cy=search-input] input").should("not.have.value", "foo");
419 it("navigates to the root project after trashing the parent of the one being displayed", function () {
420 cy.createGroup(activeUser.token, {
421 name: `Test root project ${Math.floor(Math.random() * 999999)}`,
422 group_class: "project",
424 .as("testRootProject")
426 cy.createGroup(activeUser.token, {
427 name: `Test subproject ${Math.floor(Math.random() * 999999)}`,
428 group_class: "project",
429 owner_uuid: this.testRootProject.uuid,
431 .as("testSubProject")
433 cy.createGroup(activeUser.token, {
434 name: `Test sub subproject ${Math.floor(Math.random() * 999999)}`,
435 group_class: "project",
436 owner_uuid: this.testSubProject.uuid,
437 }).as("testSubSubProject");
440 cy.getAll("@testRootProject", "@testSubProject", "@testSubSubProject").then(function ([testRootProject, testSubProject, testSubSubProject]) {
441 cy.loginAs(activeUser);
443 // Go to innermost project and trash its parent.
444 cy.goToPath(`/projects/${testSubSubProject.uuid}`);
445 cy.get("[data-cy=side-panel-tree]").should('exist');
446 cy.get("[data-cy=side-panel-tree]").should("contain", testSubSubProject.name);
448 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
449 cy.get("[data-cy=breadcrumb-last]").should("contain", testSubSubProject.name);
450 cy.get("[data-cy=side-panel-tree]").contains(testSubProject.name).rightclick();
451 cy.get("[data-cy=context-menu]").contains("Move to trash").click();
453 // Confirm that the trashed project's parent should be displayed.
455 cy.get("[data-cy=breadcrumb-last]").should('exist', { timeout: 10000 });
456 cy.get("[data-cy=breadcrumb-last]").should("contain", testRootProject.name);
457 cy.url().should("contain", `/projects/${testRootProject.uuid}`);
458 cy.get("[data-cy=side-panel-tree]").should("not.contain", testSubProject.name);
459 cy.get("[data-cy=side-panel-tree]").should("not.contain", testSubSubProject.name);
461 // Checks for bugfix #17637.
462 cy.get("[data-cy=not-found-content]").should("not.exist");
463 cy.get("[data-cy=not-found-page]").should("not.exist");
467 it("clears search input when changing project", () => {
468 cy.createGroup(activeUser.token, {
469 name: `Test root project ${Math.floor(Math.random() * 999999)}`,
470 group_class: "project",
473 .then(testProject1 => {
474 cy.shareWith(adminUser.token, activeUser.user.uuid, testProject1.uuid, "can_write");
477 cy.getAll("@testProject1").then(function ([testProject1]) {
478 cy.loginAs(activeUser);
480 cy.get("[data-cy=side-panel-tree]").contains(testProject1.name).click();
482 cy.get("[data-cy=search-input] input").type("test123");
484 cy.get("[data-cy=side-panel-tree]").contains("Projects").click();
485 cy.get("[data-cy=search-input] input").should('exist');
486 cy.get("[data-cy=search-input] input").should("not.have.value", "test123");
490 it("opens advanced popup for project with username", () => {
491 const projectName = `Test project ${Math.floor(Math.random() * 999999)}`;
493 cy.createGroup(adminUser.token, {
495 group_class: "project",
496 }).as("mainProject");
498 cy.getAll("@mainProject").then(function ([mainProject]) {
499 cy.loginAs(adminUser);
501 cy.get("[data-cy=side-panel-tree]").contains("Groups").click();
503 cy.get("[data-cy=uuid]")
507 cy.createLink(adminUser.token, {
509 link_class: "permission",
510 head_uuid: mainProject.uuid,
514 cy.createLink(adminUser.token, {
516 link_class: "permission",
517 head_uuid: mainProject.uuid,
518 tail_uuid: activeUser.user.uuid,
521 cy.get("[data-cy=side-panel-tree]").contains("Projects").click();
523 cy.get("main").contains(projectName).rightclick();
525 cy.get("[data-cy=context-menu]").contains("API Details").click();
527 cy.get("[role=tablist]").contains("METADATA").click();
529 cy.get("td").contains(uuid).should("exist");
531 cy.get("td").contains(activeUser.user.uuid).should("exist");
536 describe("Frozen projects", () => {
538 cy.createGroup(activeUser.token, {
539 name: `Main project ${Math.floor(Math.random() * 999999)}`,
540 group_class: "project",
541 }).as("mainProject");
543 cy.createGroup(adminUser.token, {
544 name: `Admin project ${Math.floor(Math.random() * 999999)}`,
545 group_class: "project",
548 .then(mainProject => {
549 cy.shareWith(adminUser.token, activeUser.user.uuid, mainProject.uuid, "can_write");
552 cy.get("@mainProject").then(mainProject => {
553 cy.createGroup(adminUser.token, {
554 name: `Sub project ${Math.floor(Math.random() * 999999)}`,
555 group_class: "project",
556 owner_uuid: mainProject.uuid,
559 cy.createCollection(adminUser.token, {
560 name: `Main collection ${Math.floor(Math.random() * 999999)}`,
561 owner_uuid: mainProject.uuid,
562 manifest_text: "./subdir 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo\n. 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n",
563 }).as("mainCollection");
567 it("should be able to freeze own project", () => {
568 cy.getAll("@mainProject").then(([mainProject]) => {
569 cy.loginAs(activeUser);
571 cy.get("[data-cy=project-panel]").contains(mainProject.name).rightclick();
573 cy.get("[data-cy=context-menu]").contains("Freeze").click();
575 cy.get("[data-cy=project-panel]").contains(mainProject.name).rightclick();
577 cy.get("[data-cy=context-menu]").contains("Freeze").should("not.exist");
581 it("should not be able to modify items within the frozen project", () => {
582 cy.getAll("@mainProject", "@mainCollection").then(([mainProject, mainCollection]) => {
583 cy.loginAs(activeUser);
585 cy.get("[data-cy=project-panel]").contains(mainProject.name).rightclick();
587 cy.get("[data-cy=context-menu]").contains("Freeze").click();
589 cy.get("[data-cy=project-panel]").contains(mainProject.name).click();
591 cy.get("[data-cy=project-panel]").contains(mainCollection.name).rightclick();
593 cy.get("[data-cy=context-menu]").contains("Move to trash").should("not.exist");
597 it("should be able to freeze not owned project", () => {
598 cy.getAll("@adminProject").then(([adminProject]) => {
599 cy.loginAs(activeUser);
601 cy.get("[data-cy=side-panel-tree]").contains("Shared with me").click();
603 cy.get("main").contains(adminProject.name).rightclick();
605 cy.get("[data-cy=context-menu]").contains("Freeze").should("not.exist");
609 it("should be able to unfreeze project if user is an admin", () => {
610 cy.getAll("@adminProject").then(([adminProject]) => {
611 cy.loginAs(adminUser);
613 cy.get("main").contains(adminProject.name).rightclick();
615 cy.get("[data-cy=context-menu]").contains("Freeze").click();
619 cy.get("main").contains(adminProject.name).rightclick();
621 cy.get("[data-cy=context-menu]").contains("Unfreeze").click();
623 cy.get("main").contains(adminProject.name).rightclick();
625 cy.get("[data-cy=context-menu]").contains("Freeze").should("exist");
630 // The following test is enabled on Electron only, as Chromium and Firefox
631 // require permissions to access the clipboard.
632 it("copies project URL to clipboard", { browser: 'electron' }, () => {
633 const projectName = `Test project (${Math.floor(999999 * Math.random())})`;
635 cy.loginAs(activeUser);
636 cy.get("[data-cy=side-panel-button]").click();
637 cy.get("[data-cy=side-panel-new-project]").click();
638 cy.get("[data-cy=form-dialog]")
639 .should("contain", "New Project")
641 cy.get("[data-cy=name-field]").within(() => {
642 cy.get("input").type(projectName);
644 cy.get("[data-cy=form-submit-btn]").click();
646 cy.contains("Project has been successfully created");
648 cy.get("[data-cy=form-dialog]").should("not.exist");
649 cy.get("[data-cy=snackbar]").should("not.exist");
650 cy.get("[data-cy=side-panel-tree]").contains("Projects").click();
652 cy.get("[data-cy=project-panel]").contains(projectName).should("be.visible").rightclick();
653 cy.get("[data-cy=context-menu]").contains("Copy link to clipboard").click();
654 cy.window({ timeout: 10000 }).then(win =>{
656 win.navigator.clipboard.readText().then(text => {
657 expect(text).to.match(/https\:\/\/127\.0\.0\.1\:[0-9]+\/projects\/[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}/);
662 it("sorts displayed items correctly", () => {
663 cy.loginAs(activeUser);
665 cy.get('[data-cy=project-panel] button[aria-label="Select columns"]').click();
666 cy.get("div[role=presentation] ul > div[role=button]").contains("Date Created").click();
667 cy.get("div[role=presentation] ul > div[role=button]").contains("Trash at").click();
668 cy.get("div[role=presentation] ul > div[role=button]").contains("Delete at").click();
669 cy.get("div[role=presentation] > div[aria-hidden=true]").click();
673 url: "**/arvados/v1/groups/*/contents*",
675 // Ignore the count=exact itemsavailable request
678 }).as("filteredQuery");
682 asc: "collections.name asc,groups.name asc,workflows.name asc,created_at desc",
683 desc: "collections.name desc,groups.name desc,workflows.name desc,created_at desc",
686 name: "Last Modified",
687 asc: "collections.modified_at asc,groups.modified_at asc,workflows.modified_at asc,created_at desc",
688 desc: "collections.modified_at desc,groups.modified_at desc,workflows.modified_at desc,created_at desc",
691 name: "Date Created",
692 asc: "collections.created_at asc,groups.created_at asc,workflows.created_at asc,created_at desc",
693 desc: "collections.created_at desc,groups.created_at desc,workflows.created_at desc,created_at desc",
697 asc: "collections.trash_at asc,groups.trash_at asc,workflows.trash_at asc,created_at desc",
698 desc: "collections.trash_at desc,groups.trash_at desc,workflows.trash_at desc,created_at desc",
702 asc: "collections.delete_at asc,groups.delete_at asc,workflows.delete_at asc,created_at desc",
703 desc: "collections.delete_at desc,groups.delete_at desc,workflows.delete_at desc,created_at desc",
706 cy.get("[data-cy=project-panel] table thead th").contains(test.name).click();
707 cy.wait("@filteredQuery").then(interception => {
708 const searchParams = new URLSearchParams(new URL(interception.request.url).search);
709 expect(searchParams.get("order")).to.eq(test.asc);
711 cy.get("[data-cy=project-panel] table thead th").contains(test.name).click();
712 cy.wait("@filteredQuery").then(interception => {
713 const searchParams = new URLSearchParams(new URL(interception.request.url).search);
714 expect(searchParams.get("order")).to.eq(test.desc);