From d07f664450ddaaebb44127a4bd057763d13d3f82 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Sun, 1 Nov 2020 20:55:14 +0100 Subject: Init --- test/bem/_iro-bem-suffix.scss | 94 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 test/bem/_iro-bem-suffix.scss (limited to 'test/bem/_iro-bem-suffix.scss') diff --git a/test/bem/_iro-bem-suffix.scss b/test/bem/_iro-bem-suffix.scss new file mode 100644 index 0000000..c6ca787 --- /dev/null +++ b/test/bem/_iro-bem-suffix.scss @@ -0,0 +1,94 @@ +// sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations + +// +// Included test cases: +// - /// 1 /// - block suffix +// - /// 2 /// - element suffix +// - /// 3 /// - modifier suffix +// - /// 4 /// - multiple element suffix +// + +@include it('iro-bem-suffix') { + @include assert('block suffix') { /// 1 /// + @include output { + @include iro-bem-block('something') { + @include iro-bem-suffix('sm') { + font-size: 1.5em; + } + } + } + + @include expect { + .something\@sm { + font-size: 1.5em; + } + } + } + + @include assert('element suffix') { /// 2 /// + @include output { + @include iro-bem-block('something') { + @include iro-bem-element('child') { + @include iro-bem-suffix('sm') { + font-size: 2.5em; + } + } + } + } + + @include expect { + .something__child\@sm { + font-size: 2.5em; + } + } + } + + @include assert('modifier suffix') { /// 3 /// + @include output { + @include iro-bem-block('something') { + @include iro-bem-modifier('mod1') { + @include iro-bem-suffix('sm') { + font-size: 1.75em; + } + } + + @include iro-bem-element('child') { + @include iro-bem-modifier('mod2') { + @include iro-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 iro-bem-block('something') { + @include iro-bem-element('child1', 'child2') { + @include iro-bem-suffix('sm') { + font-size: 2.5em; + } + } + } + } + + @include expect { + .something__child1\@sm, + .something__child2\@sm { + font-size: 2.5em; + } + } + } +} -- cgit v1.2.3-54-g00ecf