|
| 1 | +const expectedNamespace = "finos" |
| 2 | +const expectedFlowId = 1; |
| 3 | +const expectedFlowVersion = "1.0.0"; |
| 4 | + |
| 5 | +describe('Pattern Tests', () => { |
| 6 | + beforeEach(() => { |
| 7 | + cy.intercept("/calm/namespaces", {"values": [expectedNamespace]}); |
| 8 | + cy.intercept("/calm/namespaces/finos/flows", {"values": [expectedFlowId]}); |
| 9 | + cy.intercept("/calm/namespaces/finos/flows/1/versions", {"values": [expectedFlowVersion]}); |
| 10 | + cy.intercept("/calm/namespaces/finos/flows/1/versions/1.0.0", { |
| 11 | + fixture: "update-account-flow" |
| 12 | + }); |
| 13 | + }) |
| 14 | + |
| 15 | + it("Displays flow JSON successfully", () => { |
| 16 | + cy.visit("/"); |
| 17 | + cy.findByText(expectedNamespace).click(); |
| 18 | + cy.findByText(/flows/i).click(); |
| 19 | + cy.findByText(/1/i).click(); |
| 20 | + cy.findByText(/1.0.0/i).click(); |
| 21 | + |
| 22 | + cy.fixture('update-account-flow').then(data => { |
| 23 | + cy.contains(/\$schema/i).should("exist"); |
| 24 | + cy.contains(data.$schema).should("exist"); |
| 25 | + |
| 26 | + cy.contains(/\$id/i).should("exist"); |
| 27 | + cy.contains(data.$id).should("exist"); |
| 28 | + |
| 29 | + cy.contains(/unique-id/i).should("exist"); |
| 30 | + cy.contains(data["unique-id"]).should("exist"); |
| 31 | + |
| 32 | + cy.contains(/name/i).should("exist"); |
| 33 | + cy.contains(data.name).should("exist"); |
| 34 | + |
| 35 | + cy.contains(/description/i).should("exist"); |
| 36 | + cy.contains(data.description).should("exist"); |
| 37 | + |
| 38 | + cy.contains(/transitions/i).should("exist"); |
| 39 | + |
| 40 | + Object.entries(data.transitions[0]).forEach(([key, value]) => { |
| 41 | + cy.contains(key).should("exist"); |
| 42 | + cy.contains(value as string).should("exist"); |
| 43 | + }) |
| 44 | + |
| 45 | + }); |
| 46 | + }) |
| 47 | +}) |
0 commit comments