Skip to content

Commit

Permalink
e2e: add suproject_view_details spec
Browse files Browse the repository at this point in the history
  • Loading branch information
georgimld authored and daniel-arnauer committed Feb 9, 2021
1 parent c4efbb4 commit 387e82e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions e2e-test/cypress/integration/suproject_view_details_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
describe("Attachment icon", function() {
let projectId;
let subprojectId;

before(() => {
cy.login();

cy.createProject("workflowitem create test project", "workflowitem create test", [])
.then(({ id }) => {
projectId = id;
return cy.createSubproject(projectId, "workflowitem create test", "EUR");
})
.then(({ id }) => {
subprojectId = id;
});
});

beforeEach(function() {
cy.login();
cy.visit(`/projects/${projectId}/${subprojectId}`);
});

it("If documents array is empty, the attachedFile icon badge is not displayed", function() {
// Create a workflow item
cy.createWorkflowitem(projectId, subprojectId, "workflowitem assign test", {
amountType: "N/A",
documents: []
}).then(({ id }) => {
let workflowitemId = id;
// Check if attach file icon badge is NOT displayed
cy.get(`[data-test^='attachment-file-badge-show-${workflowitemId}']`).should("not.be.visible");
});
});

it("If documents array is not empty, the attachedFile icon badge is displayed", function() {
// Create a workflow item
cy.createWorkflowitem(projectId, subprojectId, "workflowitem assign test", {
amountType: "N/A",
documents: [
{
id: "classroom-contract",
base64: "dGVzdCBiYXNlNjRTdHJpbmc=",
fileName: "test-document"
}
]
}).then(({ id }) => {
let workflowitemId = id;
// Check if attach file icon badge is NOT displayed
cy.get(`[data-test^='attachment-file-badge-show-${workflowitemId}']`).should("be.visible");
});
});
});

0 comments on commit 387e82e

Please sign in to comment.