StylesSpec.js 749 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import Styles from 'lib/draw/Styles';
  2. describe('draw/Styles', function() {
  3. var styles = new Styles();
  4. describe('#cls', function() {
  5. it('should create style with traits given', function() {
  6. // given
  7. var expectedStyle = {
  8. 'class': 'foo',
  9. 'fill': 'none'
  10. };
  11. // when
  12. var style = styles.cls('foo', [ 'no-fill' ]);
  13. // then
  14. expect(style).to.eql(expectedStyle);
  15. });
  16. it('should create style without traits given', function() {
  17. // given
  18. var expectedStyle = {
  19. 'class': 'foo',
  20. 'fill': 'none'
  21. };
  22. // when
  23. var style = styles.cls('foo', { fill: 'none' });
  24. // then
  25. expect(style).to.eql(expectedStyle);
  26. });
  27. });
  28. });