forked from finos/architecture-as-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflows.cy.ts
More file actions
47 lines (37 loc) · 1.69 KB
/
flows.cy.ts
File metadata and controls
47 lines (37 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const expectedNamespace = { name: "finos", description: "FINOS namespace" };
const expectedFlowId = 1;
const expectedFlowVersion = "1.0.0";
describe('Flow Tests', () => {
beforeEach(() => {
cy.intercept("/calm/namespaces", {"values": [expectedNamespace]});
cy.intercept("/calm/namespaces/finos/flows", {"values": [expectedFlowId]});
cy.intercept("/calm/namespaces/finos/flows/1/versions", {"values": [expectedFlowVersion]});
cy.intercept("/calm/namespaces/finos/flows/1/versions/1.0.0", {
fixture: "update-account-flow"
});
})
it("Displays flow JSON successfully", () => {
cy.visit("/");
cy.findByText(expectedNamespace.name).click();
cy.findByText(/flows/i).click();
cy.findByText(/1/i).click();
cy.findByText(/1.0.0/i).click();
cy.fixture('update-account-flow').then(data => {
cy.contains(/\$schema/i).should("exist");
cy.contains(data.$schema).should("exist");
cy.contains(/\$id/i).should("exist");
cy.contains(data.$id).should("exist");
cy.contains(/unique-id/i).should("exist");
cy.contains(data["unique-id"]).should("exist");
cy.contains(/name/i).should("exist");
cy.contains(data.name).should("exist");
cy.contains(/description/i).should("exist");
cy.contains(data.description).should("exist");
cy.contains(/transitions/i).should("exist");
Object.entries(data.transitions[0]).forEach(([key, value]) => {
cy.contains(key).should("exist");
cy.contains(value as string).should("exist");
});
});
})
})