|
1 | 1 | import { expect } from '@vaadin/chai-plugins'; |
2 | | -import { fixtureSync, isChrome, nextFrame, nextResize } from '@vaadin/testing-helpers'; |
| 2 | +import { fixtureSync, nextFrame, nextResize } from '@vaadin/testing-helpers'; |
3 | 3 | import '../src/vaadin-icon.js'; |
4 | | -import { needsFontIconSizingFallback, supportsCQUnitsForPseudoElements } from '../src/vaadin-icon-helpers.js'; |
5 | 4 | import { iconFontCss } from './test-icon-font.js'; |
6 | 5 |
|
7 | 6 | describe('vaadin-icon - icon fonts', () => { |
@@ -268,71 +267,4 @@ describe('vaadin-icon - icon fonts', () => { |
268 | 267 | expect(['"My icons 6"', 'My icons 6']).to.include(fontIconStyle.fontFamily); |
269 | 268 | }); |
270 | 269 | }); |
271 | | - |
272 | | - // These tests make sure that the heavy container query fallback is only used |
273 | | - // when font icons are used. |
274 | | - describe('container query fallback', () => { |
275 | | - // Tests for browsers that require the fallback |
276 | | - const fallBackIt = needsFontIconSizingFallback() ? it : it.skip; |
277 | | - // Tests for browsers that we know for sure not to require the fallback |
278 | | - const supportedIt = isChrome ? it : it.skip; |
279 | | - |
280 | | - let icon; |
281 | | - |
282 | | - supportedIt('should support CQ width units on pseudo elements', () => { |
283 | | - expect(supportsCQUnitsForPseudoElements()).to.be.true; |
284 | | - }); |
285 | | - |
286 | | - supportedIt('should not need the fallback', () => { |
287 | | - expect(needsFontIconSizingFallback()).to.be.false; |
288 | | - }); |
289 | | - |
290 | | - fallBackIt('should not support CQ width units on pseudo elements', () => { |
291 | | - expect(supportsCQUnitsForPseudoElements()).to.be.false; |
292 | | - }); |
293 | | - |
294 | | - fallBackIt('should have the custom property (iconClass)', async () => { |
295 | | - icon = fixtureSync('<vaadin-icon icon-class="foo"></vaadin-icon>'); |
296 | | - await nextFrame(); |
297 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px'); |
298 | | - }); |
299 | | - |
300 | | - fallBackIt('should have the custom property (char)', async () => { |
301 | | - icon = fixtureSync('<vaadin-icon char="foo"></vaadin-icon>'); |
302 | | - await nextFrame(); |
303 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px'); |
304 | | - }); |
305 | | - |
306 | | - fallBackIt('should not have the custom property', async () => { |
307 | | - icon = fixtureSync('<vaadin-icon></vaadin-icon>'); |
308 | | - await nextFrame(); |
309 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal(''); |
310 | | - }); |
311 | | - |
312 | | - fallBackIt('should set the custom property', async () => { |
313 | | - icon = fixtureSync('<vaadin-icon></vaadin-icon>'); |
314 | | - await nextFrame(); |
315 | | - icon.iconClass = 'foo'; |
316 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('24px'); |
317 | | - }); |
318 | | - |
319 | | - fallBackIt('should update the custom property', async () => { |
320 | | - icon = fixtureSync('<vaadin-icon icon-class="foo"></vaadin-icon>'); |
321 | | - await nextFrame(); |
322 | | - icon.style.width = '100px'; |
323 | | - icon.style.height = '100px'; |
324 | | - await nextResize(icon); |
325 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal('100px'); |
326 | | - }); |
327 | | - |
328 | | - fallBackIt('should not update the custom property', async () => { |
329 | | - icon = fixtureSync('<vaadin-icon></vaadin-icon>'); |
330 | | - await nextFrame(); |
331 | | - icon.style.width = '100px'; |
332 | | - icon.style.height = '100px'; |
333 | | - await nextFrame(icon); |
334 | | - await nextFrame(icon); |
335 | | - expect(icon.style.getPropertyValue('--_vaadin-font-icon-size')).to.equal(''); |
336 | | - }); |
337 | | - }); |
338 | 270 | }); |
0 commit comments