mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
add spec for stateDB addStyleClass
This commit is contained in:
parent
278a19f87a
commit
965eae5f45
17
packages/mermaid/src/diagrams/state/stateDb.spec.js
Normal file
17
packages/mermaid/src/diagrams/state/stateDb.spec.js
Normal file
@ -0,0 +1,17 @@
|
||||
import stateDb from './stateDb';
|
||||
|
||||
describe('stateDb', () => {
|
||||
describe('addStyleClass', () => {
|
||||
it('is added to the list of style classes', () => {
|
||||
const newStyleClassId = 'newStyleClass';
|
||||
const newStyleClassAttribs = 'font-weight:bold, border:blue;';
|
||||
|
||||
stateDb.addStyleClass(newStyleClassId, newStyleClassAttribs);
|
||||
const styleClasses = stateDb.getClasses();
|
||||
expect(styleClasses[newStyleClassId].id).toEqual(newStyleClassId);
|
||||
expect(styleClasses[newStyleClassId].styles.length).toEqual(2);
|
||||
expect(styleClasses[newStyleClassId].styles[0]).toEqual('font-weight:bold');
|
||||
expect(styleClasses[newStyleClassId].styles[1]).toEqual('border:blue');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user