add spec for stateDB addStyleClass

This commit is contained in:
Ashley Engelund (weedySeaDragon @ github) 2022-10-10 18:26:31 -07:00
parent 278a19f87a
commit 965eae5f45

View 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');
});
});
});