diff --git a/packages/mermaid/src/diagrams/state/stateDb.spec.js b/packages/mermaid/src/diagrams/state/stateDb.spec.js new file mode 100644 index 000000000..786c122aa --- /dev/null +++ b/packages/mermaid/src/diagrams/state/stateDb.spec.js @@ -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'); + }); + }); +});