cicd(#5952): added test case for diagram that instigated the issue

This commit is contained in:
NicolasNewman 2024-11-15 10:28:50 -06:00
parent 885ac6f947
commit 570ae78b15
2 changed files with 52 additions and 1 deletions

View File

@ -171,6 +171,58 @@ describe.skip('architecture diagram', () => {
` `
); );
}); });
it('should render an architecture diagram with a resonable height', () => {
imgSnapshotTest(
`architecture-beta
group federated(cloud)[Federated Environment]
service server1(server)[System] in federated
service edge(server)[Edge Device] in federated
server1:R -- L:edge
group on_prem(cloud)[Hub]
service firewall(server)[Firewall Device] in on_prem
service server(server)[Server] in on_prem
firewall:R -- L:server
service db1(database)[db1] in on_prem
service db2(database)[db2] in on_prem
service db3(database)[db3] in on_prem
service db4(database)[db4] in on_prem
service db5(database)[db5] in on_prem
service db6(database)[db6] in on_prem
junction mid in on_prem
server:B -- T:mid
junction 1Leftofmid in on_prem
1Leftofmid:R -- L:mid
1Leftofmid:B -- T:db1
junction 2Leftofmid in on_prem
2Leftofmid:R -- L:1Leftofmid
2Leftofmid:B -- T:db2
junction 3Leftofmid in on_prem
3Leftofmid:R -- L:2Leftofmid
3Leftofmid:B -- T:db3
junction 1RightOfMid in on_prem
mid:R -- L:1RightOfMid
1RightOfMid:B -- T:db4
junction 2RightOfMid in on_prem
1RightOfMid:R -- L:2RightOfMid
2RightOfMid:B -- T:db5
junction 3RightOfMid in on_prem
2RightOfMid:R -- L:3RightOfMid
3RightOfMid:B -- T:db6
edge:R -- L:firewall
`
);
});
}); });
// Skipped as the layout is not deterministic, and causes issues in E2E tests. // Skipped as the layout is not deterministic, and causes issues in E2E tests.

View File

@ -183,7 +183,6 @@ function getAlignments(
} }
for (let i = 0; i < arr.length - 1; i++) { for (let i = 0; i < arr.length - 1; i++) {
for (let j = i + 1; j < arr.length; j++) { for (let j = i + 1; j < arr.length; j++) {
// Not optimal but arr will not grow large enough to be a concern
const [aGroupId, aNodeIds] = arr[i]; const [aGroupId, aNodeIds] = arr[i];
const [bGroupId, bNodeIds] = arr[j]; const [bGroupId, bNodeIds] = arr[j];
const alignment = groupAlignments[aGroupId]?.[bGroupId]; // Get how the two groups are intended to align (undefined if they aren't) const alignment = groupAlignments[aGroupId]?.[bGroupId]; // Get how the two groups are intended to align (undefined if they aren't)