-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: add suproject_view_details spec
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
e2e-test/cypress/integration/suproject_view_details_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
}); | ||
}); | ||
}); |