diff options
Diffstat (limited to 'test/bem/_iro-bem-state.scss')
| -rw-r--r-- | test/bem/_iro-bem-state.scss | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/test/bem/_iro-bem-state.scss b/test/bem/_iro-bem-state.scss new file mode 100644 index 0000000..57eb233 --- /dev/null +++ b/test/bem/_iro-bem-state.scss | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | // sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations | ||
| 2 | |||
| 3 | // | ||
| 4 | // Included test cases: | ||
| 5 | // - /// 1 /// - single block, single state | ||
| 6 | // - /// 2 /// - single element, single state | ||
| 7 | // - /// 3 /// - single block, multiple states | ||
| 8 | // - /// 4 /// - single element, multiple states | ||
| 9 | // - /// 5 /// - multiple elements, single state | ||
| 10 | // - /// 6 /// - multiple elements, multiple states | ||
| 11 | // | ||
| 12 | |||
| 13 | @include it('iro-bem-state') { | ||
| 14 | @include assert('single block, single state') { /// 1 /// | ||
| 15 | @include output { | ||
| 16 | @include iro-bem-block('something') { | ||
| 17 | @include iro-bem-is('active') { | ||
| 18 | font-size: 1.25em; | ||
| 19 | } | ||
| 20 | |||
| 21 | @include iro-bem-has('state') { | ||
| 22 | font-size: 1.75em; | ||
| 23 | } | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | @include expect { | ||
| 28 | .something.is-active { | ||
| 29 | font-size: 1.25em; | ||
| 30 | } | ||
| 31 | |||
| 32 | .something.has-state { | ||
| 33 | font-size: 1.75em; | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | @include assert('single element, single state') { /// 2 /// | ||
| 39 | @include output { | ||
| 40 | @include iro-bem-block('something') { | ||
| 41 | @include iro-bem-element('child') { | ||
| 42 | @include iro-bem-is('active') { | ||
| 43 | font-size: 2.25em; | ||
| 44 | } | ||
| 45 | |||
| 46 | @include iro-bem-has('state') { | ||
| 47 | font-size: 2.75em; | ||
| 48 | } | ||
| 49 | } | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | @include expect { | ||
| 54 | .something__child.is-active { | ||
| 55 | font-size: 2.25em; | ||
| 56 | } | ||
| 57 | |||
| 58 | .something__child.has-state { | ||
| 59 | font-size: 2.75em; | ||
| 60 | } | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | @include assert('single block, multiple states') { /// 3 /// | ||
| 65 | @include output { | ||
| 66 | @include iro-bem-block('something') { | ||
| 67 | @include iro-bem-is('active', 'primary') { | ||
| 68 | font-size: 1.25em; | ||
| 69 | } | ||
| 70 | |||
| 71 | @include iro-bem-has('state', 'indicator') { | ||
| 72 | font-size: 1.75em; | ||
| 73 | } | ||
| 74 | } | ||
| 75 | } | ||
| 76 | |||
| 77 | @include expect { | ||
| 78 | .something.is-active, | ||
| 79 | .something.is-primary { | ||
| 80 | font-size: 1.25em; | ||
| 81 | } | ||
| 82 | |||
| 83 | .something.has-state, | ||
| 84 | .something.has-indicator { | ||
| 85 | font-size: 1.75em; | ||
| 86 | } | ||
| 87 | } | ||
| 88 | } | ||
| 89 | |||
| 90 | @include assert('single element, multiple states') { /// 4 /// | ||
| 91 | @include output { | ||
| 92 | @include iro-bem-block('something') { | ||
| 93 | @include iro-bem-element('child') { | ||
| 94 | @include iro-bem-is('active', 'primary') { | ||
| 95 | font-size: 2.25em; | ||
| 96 | } | ||
| 97 | |||
| 98 | @include iro-bem-has('state', 'indicator') { | ||
| 99 | font-size: 2.75em; | ||
| 100 | } | ||
| 101 | } | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | @include expect { | ||
| 106 | .something__child.is-active, | ||
| 107 | .something__child.is-primary { | ||
| 108 | font-size: 2.25em; | ||
| 109 | } | ||
| 110 | |||
| 111 | .something__child.has-state, | ||
| 112 | .something__child.has-indicator { | ||
| 113 | font-size: 2.75em; | ||
| 114 | } | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | @include assert('multiple elements, single state') { /// 5 /// | ||
| 119 | @include output { | ||
| 120 | @include iro-bem-block('something') { | ||
| 121 | @include iro-bem-element('child1', 'child2') { | ||
| 122 | @include iro-bem-is('active') { | ||
| 123 | font-size: 2.25em; | ||
| 124 | } | ||
| 125 | |||
| 126 | @include iro-bem-has('state') { | ||
| 127 | font-size: 2.75em; | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | @include expect { | ||
| 134 | .something__child1.is-active, | ||
| 135 | .something__child2.is-active { | ||
| 136 | font-size: 2.25em; | ||
| 137 | } | ||
| 138 | |||
| 139 | .something__child1.has-state, | ||
| 140 | .something__child2.has-state { | ||
| 141 | font-size: 2.75em; | ||
| 142 | } | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | @include assert('multiple elements, multiple states') { /// 6 /// | ||
| 147 | @include output { | ||
| 148 | @include iro-bem-block('something') { | ||
| 149 | @include iro-bem-element('child1', 'child2') { | ||
| 150 | @include iro-bem-is('active', 'primary') { | ||
| 151 | font-size: 2.25em; | ||
| 152 | } | ||
| 153 | |||
| 154 | @include iro-bem-has('state', 'indicator') { | ||
| 155 | font-size: 2.75em; | ||
| 156 | } | ||
| 157 | } | ||
| 158 | } | ||
| 159 | } | ||
| 160 | |||
| 161 | @include expect { | ||
| 162 | .something__child1.is-active, | ||
| 163 | .something__child2.is-active, | ||
| 164 | .something__child1.is-primary, | ||
| 165 | .something__child2.is-primary { | ||
| 166 | font-size: 2.25em; | ||
| 167 | } | ||
| 168 | |||
| 169 | .something__child1.has-state, | ||
| 170 | .something__child2.has-state, | ||
| 171 | .something__child1.has-indicator, | ||
| 172 | .something__child2.has-indicator { | ||
| 173 | font-size: 2.75em; | ||
| 174 | } | ||
| 175 | } | ||
| 176 | } | ||
| 177 | } | ||
