From dd5f3c463fab336d694f426dcad11a1783590fc9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 5 Feb 2022 07:52:13 +0100 Subject: Ported from import syntax to modules --- test/bem/_suffix.scss | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 test/bem/_suffix.scss (limited to 'test/bem/_suffix.scss') diff --git a/test/bem/_suffix.scss b/test/bem/_suffix.scss new file mode 100644 index 0000000..34f55b6 --- /dev/null +++ b/test/bem/_suffix.scss @@ -0,0 +1,97 @@ +// sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations + +@use 'true' as *; +@use '../../src/bem'; + +// +// Included test cases: +// - /// 1 /// - block suffix +// - /// 2 /// - element suffix +// - /// 3 /// - modifier suffix +// - /// 4 /// - multiple element suffix +// + +@include it('suffix') { + @include assert('block suffix') { /// 1 /// + @include output { + @include bem.block('something') { + @include bem.suffix('sm') { + font-size: 1.5em; + } + } + } + + @include expect { + .something\@sm { + font-size: 1.5em; + } + } + } + + @include assert('element suffix') { /// 2 /// + @include output { + @include bem.block('something') { + @include bem.elem('child') { + @include bem.suffix('sm') { + font-size: 2.5em; + } + } + } + } + + @include expect { + .something__child\@sm { + font-size: 2.5em; + } + } + } + + @include assert('modifier suffix') { /// 3 /// + @include output { + @include bem.block('something') { + @include bem.modifier('mod1') { + @include bem.suffix('sm') { + font-size: 1.75em; + } + } + + @include bem.elem('child') { + @include bem.modifier('mod2') { + @include bem.suffix('sm') { + font-size: 2.75em; + } + } + } + } + } + + @include expect { + .something--mod1\@sm { + font-size: 1.75em; + } + + .something__child--mod2\@sm { + font-size: 2.75em; + } + } + } + + @include assert('multiple element suffix') { /// 4 /// + @include output { + @include bem.block('something') { + @include bem.elem('child1', 'child2') { + @include bem.suffix('sm') { + font-size: 2.5em; + } + } + } + } + + @include expect { + .something__child1\@sm, + .something__child2\@sm { + font-size: 2.5em; + } + } + } +} -- cgit v1.3.1