Use courier in all rendering tests

This commit is contained in:
Knut Sveidqvist
2020-08-16 21:49:36 +02:00
parent 236332d8c7
commit 6b23c71bb5
17 changed files with 191 additions and 107 deletions

View File

@@ -11,7 +11,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false }, fontFamily: 'courier' }
);
});
@@ -24,7 +24,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,
{ flowchart: { htmlLabels: true } }
{ flowchart: { htmlLabels: true }, fontFamily: 'courier' }
);
});
@@ -38,7 +38,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[Car]
`,
{}
{fontFamily: 'courier'}
);
});
@@ -53,7 +53,7 @@ describe('Flowchart', () => {
C -->|Two| E[\\iPhone\\]
C -->|Three| F[Car]
`,
{}
{ fontFamily: 'courier'}
);
});
@@ -69,7 +69,7 @@ describe('Flowchart', () => {
classDef processHead fill:#888888,color:white,font-weight:bold,stroke-width:3px,stroke:#001f3f
class 1A,1B,D,E processHead
`,
{}
{fontFamily: 'courier'}
);
});
@@ -98,7 +98,7 @@ describe('Flowchart', () => {
35(SAM.CommonFA.PopulationFME)-->39(SAM.CommonFA.ChargeDetails)
36(SAM.CommonFA.PremetricCost)-->39(SAM.CommonFA.ChargeDetails)
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -169,7 +169,7 @@ describe('Flowchart', () => {
9a072290_1ec3_e711_8c5a_005056ad0002-->d6072290_1ec3_e711_8c5a_005056ad0002
9a072290_1ec3_e711_8c5a_005056ad0002-->71082290_1ec3_e711_8c5a_005056ad0002
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -178,7 +178,7 @@ describe('Flowchart', () => {
`
graph TB;subgraph "number as labels";1;end;
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -190,7 +190,7 @@ describe('Flowchart', () => {
a1-->a2
end
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -202,7 +202,7 @@ describe('Flowchart', () => {
a1-->a2
end
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -237,7 +237,7 @@ describe('Flowchart', () => {
style foo fill:#F99,stroke-width:2px,stroke:#F0F
style bar fill:#999,stroke-width:10px,stroke:#0F0
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -339,7 +339,7 @@ describe('Flowchart', () => {
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4DA958A0-26D9-4D47-93A7-70F39FD7D51A;
sid-7CE72B24-E0C1-46D3-8132-8BA66BE05AA7-->sid-4FC27B48-A6F9-460A-A675-021F5854FE22;
`,
{}
{ fontFamily: 'courier' }
);
});
@@ -356,6 +356,7 @@ describe('Flowchart', () => {
{
listUrl: false,
listId: 'color styling',
fontFamily: 'courier',
logLevel: 0
}
);
@@ -378,7 +379,7 @@ describe('Flowchart', () => {
`,
{
listUrl: false,
listId: 'color styling',
listId: 'color styling', fontFamily: 'courier',
logLevel: 0
}
);
@@ -394,7 +395,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -413,7 +414,7 @@ describe('Flowchart', () => {
class A someclass;
class C someclass;
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -430,7 +431,7 @@ describe('Flowchart', () => {
linkStyle 1 stroke:DarkGray,stroke-width:2px
linkStyle 2 stroke:DarkGray,stroke-width:2px
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -439,7 +440,7 @@ describe('Flowchart', () => {
`graph LR
a --> b --> c
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -448,7 +449,7 @@ describe('Flowchart', () => {
`graph LR
a --> b & c--> d
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -458,7 +459,7 @@ describe('Flowchart', () => {
A[ h ] -- hello --> B[" test "]:::exClass & C --> D;
classDef exClass background:#bbb,border:1px solid red;
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -480,7 +481,7 @@ describe('Flowchart', () => {
click B testClick "click test"
classDef someclass fill:#f96;
class A someclass;`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -494,7 +495,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,
{ flowchart: { nodeSpacing: 50 } }
{ flowchart: { nodeSpacing: 50 }, fontFamily: 'courier' }
);
});
@@ -508,7 +509,7 @@ describe('Flowchart', () => {
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,
{ flowchart: { rankSpacing: '100' } }
{ flowchart: { rankSpacing: '100' }, fontFamily: 'courier' }
);
});
@@ -521,7 +522,7 @@ describe('Flowchart', () => {
linkStyle 1 stroke:greenyellow,stroke-width:2px
style C fill:greenyellow,stroke:green,stroke-width:4px
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -543,7 +544,7 @@ describe('Flowchart', () => {
click E "notes://do-your-thing/id" "other protocol test"
click F "javascript:alert('test')" "script test"
`,
{ securityLevel: 'loose' }
{ securityLevel: 'loose', fontFamily: 'courier' }
);
});
@@ -583,7 +584,7 @@ describe('Flowchart', () => {
click B "index.html#link-clicked" "link test"
click D testClick "click test"
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -615,7 +616,7 @@ describe('Flowchart', () => {
class A myClass1
class D myClass2
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -639,7 +640,7 @@ describe('Flowchart', () => {
classDef redBg fill:#622;
classDef whiteTxt color: white;
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -651,7 +652,7 @@ describe('Flowchart', () => {
eat --> sleep
work --> eat
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});
@@ -670,7 +671,7 @@ describe('Flowchart', () => {
class A someclass;
class C someclass;
`,
{ flowchart: { htmlLabels: false } }
{ flowchart: { htmlLabels: false } , fontFamily: 'courier'}
);
});

View File

@@ -29,7 +29,7 @@ context('Sequence diagram', () => {
Alice -->> John: Parallel message 2
end
`,
{}
{sequence:{actorFontFamily:'courier'}}
);
});
it('should handle different line breaks', () => {
@@ -92,7 +92,7 @@ context('Sequence diagram', () => {
Alice->>Bob: I'm short
Bob->>Alice: Short as well
`,
{ sequence: { actorFontSize: 18, actorFontFamily: 'Arial' } }
{ sequence: { actorFontSize: 18, actorFontFamily: 'times' } }
);
});
it('should render notes aligned to the left when configured', () => {

View File

@@ -7,7 +7,7 @@ describe('State diagram', () => {
`
info
`,
{ logLevel: 1 }
{ logLevel: 1, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -19,7 +19,7 @@ describe('State diagram', () => {
[*] --> State1
State1 --> [*]
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -31,7 +31,7 @@ describe('State diagram', () => {
[*] --> S1
state "Some long name" as S1
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -43,7 +43,7 @@ describe('State diagram', () => {
[*] --> S1
state "Some long name" as S1: The description
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -54,7 +54,7 @@ describe('State diagram', () => {
state "A long long name" as long1
state "A" as longlonglongid
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -68,7 +68,7 @@ describe('State diagram', () => {
S1 --> S3: long line using <br>should work
S1 --> S4: long line using \\nshould work
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -82,7 +82,7 @@ describe('State diagram', () => {
notes.
end note
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -96,7 +96,7 @@ describe('State diagram', () => {
notes with . and in them.
end note
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -112,7 +112,7 @@ describe('State diagram', () => {
State1 --> State2 : With +,-
note left of State2 : This is the note +,-<br/>
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -128,7 +128,7 @@ describe('State diagram', () => {
And another line...
end note
`,
{}
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should handle multiline notes with different line breaks', () => {
@@ -140,7 +140,7 @@ describe('State diagram', () => {
Line1<br>Line2<br/>Line3<br />Line4<br />Line5
end note
`,
{}
{ logLevel: 0, fontFamily: 'courier' }
);
});
@@ -155,7 +155,7 @@ describe('State diagram', () => {
State1 --> State2
State2 --> [*]
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -168,7 +168,7 @@ describe('State diagram', () => {
State1 --> State3
State1 --> [*]
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -184,7 +184,7 @@ describe('State diagram', () => {
State2 --> State3 : Transition 5
State1 --> [*]
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -197,7 +197,7 @@ describe('State diagram', () => {
XState2 : New line
XState1 --> XState2
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -216,7 +216,7 @@ describe('State diagram', () => {
Configuring --> Idle : EvConfig EvConfig EvConfig EvConfig EvConfig
}
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -246,7 +246,7 @@ describe('State diagram', () => {
}
}
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should render forks in composit states', () => {
@@ -268,7 +268,7 @@ describe('State diagram', () => {
State4 --> [*]
}
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('v2 should render forks and joins', () => {
@@ -286,7 +286,7 @@ describe('State diagram', () => {
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -310,7 +310,7 @@ describe('State diagram', () => {
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
`,
{ logLevel: 0 }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -338,7 +338,7 @@ describe('State diagram', () => {
}
`,
{
logLevel: 0,
logLevel: 0, fontFamily: 'courier'
}
);
});
@@ -350,7 +350,7 @@ describe('State diagram', () => {
a --> b: Stop
`,
{
logLevel: 0,
logLevel: 0, fontFamily: 'courier',
}
);
});

View File

@@ -9,7 +9,7 @@ describe('State diagram', () => {
[*] --> State1
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -21,7 +21,7 @@ describe('State diagram', () => {
[*] --> S1
state "Some long name" as S1
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -33,7 +33,7 @@ describe('State diagram', () => {
[*] --> S1
state "Some long name" as S1: The description
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -44,7 +44,7 @@ describe('State diagram', () => {
state "A long long name" as long1
state "A" as longlonglongid
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -58,7 +58,7 @@ describe('State diagram', () => {
S1 --> S3: long line using <br>should work
S1 --> S4: long line using \\nshould work
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -72,7 +72,7 @@ describe('State diagram', () => {
notes.
end note
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -86,7 +86,7 @@ describe('State diagram', () => {
notes with . and in them.
end note
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -102,7 +102,7 @@ describe('State diagram', () => {
State1 --> State2 : With +,-
note left of State2 : This is the note +,-<br/>
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -118,7 +118,7 @@ describe('State diagram', () => {
And another line...
end note
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should handle multiline notes with different line breaks', () => {
@@ -130,7 +130,7 @@ describe('State diagram', () => {
Line1<br>Line2<br/>Line3<br />Line4<br />Line5
end note
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
});
@@ -145,7 +145,7 @@ describe('State diagram', () => {
State1 --> State2
State2 --> [*]
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -158,7 +158,7 @@ describe('State diagram', () => {
State1 --> State3
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -174,7 +174,7 @@ describe('State diagram', () => {
State2 --> State3 : Transition 5
State1 --> [*]
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -187,7 +187,7 @@ describe('State diagram', () => {
XState2 : New line
XState1 --> XState2
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -206,7 +206,7 @@ describe('State diagram', () => {
Configuring --> Idle : EvConfig EvConfig EvConfig EvConfig EvConfig
}
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -236,7 +236,7 @@ describe('State diagram', () => {
}
}
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should render forks in composit states', () => {
@@ -258,7 +258,7 @@ describe('State diagram', () => {
State4 --> [*]
}
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
});
it('should render forks and joins', () => {
@@ -276,7 +276,7 @@ describe('State diagram', () => {
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -300,7 +300,7 @@ describe('State diagram', () => {
ScrollLockOn --> ScrollLockOff : EvCapsLockPressed
}
`,
{ logLevel: 0, fontFamily: 'Arial' }
{ logLevel: 0, fontFamily: 'courier' }
);
cy.get('svg');
});
@@ -315,7 +315,7 @@ describe('State diagram', () => {
}
`,
{
logLevel: 0, fontFamily: 'Arial'
logLevel: 0, fontFamily: 'courier'
}
);
});
@@ -328,7 +328,7 @@ describe('State diagram', () => {
}
`,
{
logLevel: 0, fontFamily: 'Arial'
logLevel: 0, fontFamily: 'courier'
}
);
});
@@ -340,7 +340,7 @@ describe('State diagram', () => {
a --> b: Stop
`,
{
logLevel: 0, fontFamily: 'Arial'
logLevel: 0, fontFamily: 'courier'
}
);
});

View File

@@ -23,7 +23,7 @@ describe('Pie Chart', () => {
it('should render a flowchart diagram', () => {
imgSnapshotTest(
`
%%{init: { 'logLevel': 0, 'theme': '${theme}'} }%%
%%{init: { 'logLevel': 0} }%%
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}