|
1 | 1 | import { expect } from '@vaadin/chai-plugins'; |
2 | | -import { fixtureSync, nextResize } from '@vaadin/testing-helpers'; |
| 2 | +import { fixtureSync, nextFrame, nextResize } from '@vaadin/testing-helpers'; |
3 | 3 | import '../../src/vaadin-form-layout.js'; |
4 | 4 |
|
5 | 5 | const DEFAULT_COLUMN_WIDTH = '12em'; |
@@ -161,4 +161,41 @@ describe('vaadin-form-layout', () => { |
161 | 161 | await expect(layout).dom.to.equalSnapshot(); |
162 | 162 | }); |
163 | 163 | }); |
| 164 | + |
| 165 | + describe('responsive-steps', () => { |
| 166 | + beforeEach(async () => { |
| 167 | + layout = fixtureSync(` |
| 168 | + <vaadin-form-layout> |
| 169 | + <input placeholder="First name" /> |
| 170 | + <input placeholder="Last name" /> |
| 171 | + </vaadin-form-layout> |
| 172 | + `); |
| 173 | + layout.responsiveSteps = [{ columns: 2, labelsPosition: 'top' }]; |
| 174 | + await nextFrame(); |
| 175 | + }); |
| 176 | + |
| 177 | + describe('host', () => { |
| 178 | + it('default', async () => { |
| 179 | + await expect(layout).dom.to.equalSnapshot(); |
| 180 | + }); |
| 181 | + |
| 182 | + it('switching to autoResponsive', async () => { |
| 183 | + layout.autoResponsive = true; |
| 184 | + await nextResize(layout); |
| 185 | + await expect(layout).dom.to.equalSnapshot(); |
| 186 | + }); |
| 187 | + }); |
| 188 | + |
| 189 | + describe('shadow', () => { |
| 190 | + it('default', async () => { |
| 191 | + await expect(layout).shadowDom.to.equalSnapshot(); |
| 192 | + }); |
| 193 | + |
| 194 | + it('switching to autoResponsive', async () => { |
| 195 | + layout.autoResponsive = true; |
| 196 | + await nextResize(layout); |
| 197 | + await expect(layout).shadowDom.to.equalSnapshot(); |
| 198 | + }); |
| 199 | + }); |
| 200 | + }); |
164 | 201 | }); |
0 commit comments