diff options
Diffstat (limited to 'test/bem/_iro-bem-next-twin-element.scss')
| -rw-r--r-- | test/bem/_iro-bem-next-twin-element.scss | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/test/bem/_iro-bem-next-twin-element.scss b/test/bem/_iro-bem-next-twin-element.scss new file mode 100644 index 0000000..96fc3a9 --- /dev/null +++ b/test/bem/_iro-bem-next-twin-element.scss | |||
| @@ -0,0 +1,153 @@ | |||
| 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 element | ||
| 6 | // - /// 2 /// - single element, manual selector in-between | ||
| 7 | // - /// 3 /// - single element, modifier in-between | ||
| 8 | // - /// 4 /// - multiple elements | ||
| 9 | // - /// 5 /// - multiple elements, manual selector in-between | ||
| 10 | // - /// 6 /// - multiple elements, modifier in-between | ||
| 11 | // | ||
| 12 | |||
| 13 | @include it('iro-bem-next-twin-element') { | ||
| 14 | @include assert('single element') { /// 1 /// | ||
| 15 | @include output { | ||
| 16 | @include iro-bem-block('something') { | ||
| 17 | @include iro-bem-element('child') { | ||
| 18 | @include iro-bem-next-twin-element { | ||
| 19 | font-size: 2em; | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
| 24 | |||
| 25 | @include expect { | ||
| 26 | .something__child + .something__child { | ||
| 27 | font-size: 2em; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | @include assert('single element, manual selector in-between') { /// 2 /// | ||
| 33 | @include output(false) { | ||
| 34 | @include iro-bem-block('something') { | ||
| 35 | @include iro-bem-element('child') { | ||
| 36 | &:hover { | ||
| 37 | @include iro-bem-next-twin-element { | ||
| 38 | font-size: 2em; | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | .test & { | ||
| 43 | @include iro-bem-next-twin-element { | ||
| 44 | font-size: 2em; | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | @include expect(false) { | ||
| 52 | .something__child:hover + .something__child { | ||
| 53 | font-size: 2em; | ||
| 54 | } | ||
| 55 | |||
| 56 | .test .something__child + .something__child { | ||
| 57 | font-size: 2em; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | @include assert('single element, modifier in-between') { /// 3 /// | ||
| 63 | @include output { | ||
| 64 | @include iro-bem-block('something') { | ||
| 65 | @include iro-bem-element('child') { | ||
| 66 | @include iro-bem-modifier('mod') { | ||
| 67 | @include iro-bem-next-twin-element { | ||
| 68 | font-size: 2.5em; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | @include expect { | ||
| 76 | .something__child--mod + .something__child { | ||
| 77 | font-size: 2.5em; | ||
| 78 | } | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | @include assert('multiple elements') { /// 4 /// | ||
| 83 | @include output { | ||
| 84 | @include iro-bem-block('something') { | ||
| 85 | @include iro-bem-element('child1', 'child2') { | ||
| 86 | @include iro-bem-next-twin-element { | ||
| 87 | font-size: 2em; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
| 91 | } | ||
| 92 | |||
| 93 | @include expect { | ||
| 94 | .something__child1 + .something__child1, | ||
| 95 | .something__child2 + .something__child2 { | ||
| 96 | font-size: 2em; | ||
| 97 | } | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | @include assert('multiple elements, manual selector in-between') { /// 5 /// | ||
| 102 | @include output(false) { | ||
| 103 | @include iro-bem-block('something') { | ||
| 104 | @include iro-bem-element('child1', 'child2') { | ||
| 105 | &:hover { | ||
| 106 | @include iro-bem-next-twin-element { | ||
| 107 | font-size: 2em; | ||
| 108 | } | ||
| 109 | } | ||
| 110 | |||
| 111 | .test & { | ||
| 112 | @include iro-bem-next-twin-element { | ||
| 113 | font-size: 2em; | ||
| 114 | } | ||
| 115 | } | ||
| 116 | } | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | @include expect(false) { | ||
| 121 | .something__child1:hover + .something__child1, | ||
| 122 | .something__child2:hover + .something__child2 { | ||
| 123 | font-size: 2em; | ||
| 124 | } | ||
| 125 | |||
| 126 | .test .something__child1 + .something__child1, | ||
| 127 | .test .something__child2 + .something__child2 { | ||
| 128 | font-size: 2em; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | @include assert('multiple elements, modifier in-between') { /// 6 /// | ||
| 134 | @include output { | ||
| 135 | @include iro-bem-block('something') { | ||
| 136 | @include iro-bem-element('child1', 'child2') { | ||
| 137 | @include iro-bem-modifier('mod') { | ||
| 138 | @include iro-bem-next-twin-element { | ||
| 139 | font-size: 2.5em; | ||
| 140 | } | ||
| 141 | } | ||
| 142 | } | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | @include expect { | ||
| 147 | .something__child1--mod + .something__child1, | ||
| 148 | .something__child2--mod + .something__child2 { | ||
| 149 | font-size: 2.5em; | ||
| 150 | } | ||
| 151 | } | ||
| 152 | } | ||
| 153 | } | ||
