forked from finos/architecture-as-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadrs.cy.ts
More file actions
44 lines (36 loc) · 1.64 KB
/
adrs.cy.ts
File metadata and controls
44 lines (36 loc) · 1.64 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
const expectedNamespace = { name: "finos", description: "FINOS namespace" };
const expectedAdrId = 1;
const expectedAdrRevision = 2;
describe('ADR Tests', () => {
beforeEach(() => {
cy.intercept("/calm/namespaces", {"values": [expectedNamespace]});
cy.intercept("/calm/namespaces/finos/adrs", {"values": [expectedAdrId]});
cy.intercept("/calm/namespaces/finos/adrs/1/revisions", {"values": [expectedAdrRevision]});
cy.intercept(`/calm/namespaces/finos/adrs/1/revisions/${expectedAdrRevision}`, {
fixture: "example-adr"
});
})
it("Displays ADR JSON successfully", () => {
cy.visit("/");
cy.findByText(expectedNamespace.name).click();
cy.findByText(/adrs/i).click();
cy.findByText(/1/i).click();
cy.findByText(expectedAdrRevision).click();
cy.fixture('example-adr').then(data => {
cy.contains(/id/i).should("exist");
cy.contains(data.id).should("exist");
cy.contains(/namespace/i).should("exist");
cy.contains(data.namespace).should("exist");
cy.contains(data.revision).should("exist");
cy.contains(data.adr.title).should("exist");
cy.contains(data.adr.status, {
matchCase: false
}).should("exist");
cy.contains(/context and problem/i).should("exist")
cy.contains(data.adr.contextAndProblemStatement).should("exist");
cy.contains(/decision drivers/i).should("exist")
cy.contains(/considered options/i).should("exist")
cy.contains(/decision outcome/i).should("exist")
});
})
})