mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-23 13:46:45 +02:00
test(e2e): projects list
This commit is contained in:
parent
df29999d38
commit
c6e3d2a105
36
frontend/cypress/integration/projects/list.spec.ts
Normal file
36
frontend/cypress/integration/projects/list.spec.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
///<reference path="../../global.d.ts" />
|
||||||
|
import {
|
||||||
|
SEARCH_INPUT,
|
||||||
|
//@ts-ignore
|
||||||
|
} from '../../../src/utils/testIds';
|
||||||
|
|
||||||
|
describe('project overview', () => {
|
||||||
|
const randomId = String(Math.random()).split('.')[1];
|
||||||
|
const projectName = `unleash-e2e-projects-list-${randomId}`;
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
cy.runBefore();
|
||||||
|
cy.login_UI();
|
||||||
|
cy.createProject_API(projectName);
|
||||||
|
});
|
||||||
|
|
||||||
|
after(() => {
|
||||||
|
cy.deleteProject_API(projectName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('allows for searching and persists search query', () => {
|
||||||
|
cy.login_UI();
|
||||||
|
cy.visit(`/projects`);
|
||||||
|
cy.get(`[data-testid="${SEARCH_INPUT}"]`).as('search').click();
|
||||||
|
cy.get('@search').type(projectName);
|
||||||
|
cy.url().should('include', `search=${projectName}`);
|
||||||
|
cy.get('h1').contains('Projects (1 of');
|
||||||
|
|
||||||
|
cy.get('[data-testid=PROJECT_CARD_LINK]').contains(projectName).click();
|
||||||
|
cy.get('nav').contains('Projects').click();
|
||||||
|
|
||||||
|
cy.url().should('include', `search=${projectName}`);
|
||||||
|
cy.get('@search').clear();
|
||||||
|
cy.url().should('not.include', `search=${projectName}`);
|
||||||
|
});
|
||||||
|
});
|
@ -340,6 +340,7 @@ export const ProjectListNew = () => {
|
|||||||
<StyledCardLink
|
<StyledCardLink
|
||||||
key={project.id}
|
key={project.id}
|
||||||
to={`/projects/${project.id}`}
|
to={`/projects/${project.id}`}
|
||||||
|
data-testid='PROJECT_CARD_LINK'
|
||||||
>
|
>
|
||||||
<ProjectCard
|
<ProjectCard
|
||||||
onHover={() =>
|
onHover={() =>
|
||||||
|
Loading…
Reference in New Issue
Block a user