Skip to content

Commit

Permalink
refactor and complete the test
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaiahWren committed Aug 13, 2024
1 parent f799be2 commit 2f2094a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cypress/e2e/hub/distributions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ describe('Collections Tabs: Distributions', () => {
).then((data) => {
expect(data?.results).to.have.length(1);
const distribution: Distribution = data.results[0];
const { base_path, pulp_created, name, client_url } = distribution;
const { base_path, pulp_created, name } = distribution;
const createdDate = new Date(pulp_created);
const formattedDateTime = `${createdDate.toLocaleDateString()}, ${createdDate.toLocaleTimeString()}`;
cy.checkValueByHeaderName('Name', name);
cy.checkValueByHeaderName('Base path', base_path);
cy.checkValueByHeaderName('Created', formattedDateTime);
cy.checkValueByHeaderName('CLI Configuration', client_url);
cy.get('button[aria-label="Copy to clipboard"]').click();
cy.get('[data-cy="alert-toaster"]').should('be.visible');
cy.get('[data-cy="alert-toaster"]').within(() => {
cy.get('button').click();
});
});
});
});

0 comments on commit 2f2094a

Please sign in to comment.