1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 describe('Details panel', () => {
9 cy.getUser("active", "Active", "User", true, true)
16 // Add this test to the existing describe block in details-panel.cy.js
18 it('displays root project details when no items are selected', () => {
19 cy.loginAs(adminUser);
21 // Navigate to the user's root project
22 cy.visit(`/projects/${adminUser.user.uuid}`);
24 // Wait for the data table to load
25 cy.get('[data-cy=data-table]').should('be.visible');
27 // Ensure no items are selected
28 cy.get('[data-cy=data-table-row] input[type="checkbox"]:checked').should('not.exist');
30 // Open the details panel
31 cy.get('[data-cy=details-panel]').should('not.exist');
32 cy.get('[data-testid=InfoIcon]').click();
33 cy.get('[data-cy=details-panel]').should('be.visible');
35 // Check if root project details are displayed
36 cy.get('[data-cy=details-panel]').within(() => {
37 cy.contains('Type').should('be.visible');
38 cy.contains('Root Project').should('be.visible');
39 cy.contains('User').should('be.visible');
40 cy.contains('Created at').should('be.visible');
41 cy.contains('UUID').should('be.visible');
43 // Verify specific root project details
44 cy.contains(adminUser.user.uuid).should('be.visible');
47 // Verify that the Root Project icon is displayed
48 cy.get('[data-cy=details-panel]').find('[data-testid=InboxIcon]').should('be.visible');
52 describe('Collection details panel', () => {
56 cy.getUser("active", "Active", "User", true, true)
63 it('displays appropriate attributes when a collection is selected', () => {
64 cy.loginAs(adminUser);
66 // Create a test collection
67 const collectionName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
68 cy.createCollection(adminUser.token, {
70 owner_uuid: adminUser.user.uuid,
71 manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo\n",
72 }).as('testCollection');
74 // Navigate to the project containing the collection
75 cy.get('@testCollection').then((collection) => {
76 cy.visit(`/projects/${adminUser.user.uuid}`);
78 // Wait for the data table to load
79 cy.get('[data-cy=data-table]').should('be.visible');
81 // Find and check the checkbox for the test collection
82 cy.contains('[data-cy=data-table-row]', collectionName)
83 .find('input[type="checkbox"]')
86 // Open the details panel
87 cy.get('[data-cy=details-panel]').should('not.exist');
88 cy.get('[data-testid=InfoIcon]').click();
89 cy.get('[data-cy=details-panel]').should('be.visible');
91 // Check if appropriate attributes are displayed
92 cy.get('[data-cy=details-panel]').within(() => {
93 cy.contains('Collection UUID').should('be.visible');
94 cy.contains('Portable data hash').should('be.visible');
95 cy.contains('Owner').should('be.visible');
96 cy.contains('Created at').should('be.visible');
97 cy.contains('Last modified').should('be.visible');
98 cy.contains('Content size').should('be.visible');
99 cy.contains('Number of files').should('be.visible');
100 cy.contains('Properties').should('be.visible');
103 // Verify specific collection details
104 cy.get('[data-cy=details-panel]').within(() => {
105 cy.contains(collection.uuid).should('be.visible');
106 cy.contains(collection.portable_data_hash).should('be.visible');
107 cy.contains(adminUser.user.uuid).should('be.visible');
108 cy.contains('1').should('be.visible'); // Number of files
109 cy.contains('3 B').should('be.visible'); // Content size