import { describe, it, expect } from 'vitest' import * as Style from '../../src/style/index.js' describe('Style', () => { describe('.Rule', () => { describe('.getClassName', () => { it('should generate selector for text element', () => { expect( Style.Rule.getEffectiveSlug( Style.Rule({ type: 'text', details: { slug: 'paragraph--test', collectionId: 'paragraph' } }), Style.Presets.all ) ).to.eq('paragraph--test') expect( Style.Rule.getClassName( Style.Rule({ type: 'text', details: { slug: 'paragraph--test', collectionId: 'paragraph' } }) ) ).to.eq('-paragraph--test') }) it('should generate selector for block elements', () => { expect( Style.Rule.getClassName( Style.Rule({ type: 'block', details: { slug: 'section--test', collectionId: 'section' } }) ) ).to.eq('-section--test') expect( Style.Rule.getClassName(Style.Rule({ type: 'block', details: { slug: 'cool--test', collectionId: 'cool' } })) ).to.eq('-block--cool--test') }) it('should generate selector for inline elements', () => { expect( Style.Rule.getClassName( Style.Rule({ type: 'inline', details: { slug: 'button--test', collectionId: 'button' } }) ) ).to.eq('-button--test') expect( Style.Rule.getClassName( Style.Rule({ type: 'inline', details: { slug: 'chippy--test', collectionId: 'chippy' } }) ) ).to.eq('-inline--chippy--test') }) }) }) })