diff --git a/core/src/components/back-button/test/basic/index.html b/core/src/components/back-button/test/basic/index.html index c43335fb69b..af2d4ef59f1 100644 --- a/core/src/components/back-button/test/basic/index.html +++ b/core/src/components/back-button/test/basic/index.html @@ -125,7 +125,7 @@

Custom

- + Hidden diff --git a/core/src/components/progress-bar/progress-bar.tsx b/core/src/components/progress-bar/progress-bar.tsx index 22e2f00d790..12ccd66dec9 100644 --- a/core/src/components/progress-bar/progress-bar.tsx +++ b/core/src/components/progress-bar/progress-bar.tsx @@ -107,6 +107,7 @@ const renderProgress = (value: number, buffer: number) => { * When finalBuffer === 1, we use display: none * instead of removing the element to avoid flickering. */ + // TODO(FW-6697): change `ion-hide` class to `ion-display-none` or another class
{ + let css: string; + + test.beforeAll(() => { + css = fs.readFileSync(path.resolve(__dirname, '../../../css/display.css'), 'utf8'); + }); + + const INFIXES = ['', '-sm', '-md', '-lg', '-xl']; + + // TODO(FW-6697): remove `ion-hide classes` test + test('ion-hide classes', () => { + expect(css).toContain('.ion-hide'); + + const values = ['up', 'down']; + + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-hide${infix}-${value}`); + } + } + }); + + test('ion-display classes', () => { + const values = [ + 'none', + 'inline', + 'inline-block', + 'block', + 'flex', + 'inline-flex', + 'grid', + 'inline-grid', + 'table', + 'table-cell', + 'table-row', + ]; + + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-display${infix}-${value}`); + } + } + }); +}); diff --git a/core/src/css/test/flex-utils.e2e.ts b/core/src/css/test/flex-utils.e2e.ts new file mode 100644 index 00000000000..d691ae9f558 --- /dev/null +++ b/core/src/css/test/flex-utils.e2e.ts @@ -0,0 +1,100 @@ +import { test, expect } from '@playwright/test'; +import fs from 'fs'; +import path from 'path'; + +test.describe('flex-utils css utility classes', () => { + let css: string; + + test.beforeAll(() => { + css = fs.readFileSync(path.resolve(__dirname, '../../../css/flex-utils.css'), 'utf8'); + }); + + const INFIXES = ['', '-sm', '-md', '-lg', '-xl']; + + test('align-content classes', () => { + const values = ['start', 'end', 'center', 'between', 'around', 'stretch']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-align-content${infix}-${value}`); + } + } + }); + + test('align-items classes', () => { + const values = ['start', 'center', 'end', 'stretch', 'baseline']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-align-items${infix}-${value}`); + } + } + }); + + test('align-self classes', () => { + const values = ['start', 'end', 'center', 'stretch', 'baseline', 'auto']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-align-self${infix}-${value}`); + } + } + }); + + test('justify-content classes', () => { + const values = ['start', 'center', 'end', 'around', 'between', 'evenly']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-justify-content${infix}-${value}`); + } + } + }); + + test('flex-direction classes', () => { + const values = ['row', 'row-reverse', 'column', 'column-reverse']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-flex${infix}-${value}`); + } + } + }); + + test('flex-wrap classes', () => { + const values = ['wrap', 'nowrap', 'wrap-reverse']; + // TODO(FW-6697): remove all `ion-wrap-*` expects + for (const value of values) { + expect(css).toContain(`.ion-${value}`); + } + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-flex${infix}-${value}`); + } + } + }); + + test('flex-fill classes', () => { + const values = ['1', 'auto', 'initial', 'none']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-flex${infix}-${value}`); + } + } + }); + + test('flex-grow and flex-shrink classes', () => { + const values = ['grow', 'shrink']; + for (const value of values) { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-flex${infix}-${value}-0`); + expect(css).toContain(`.ion-flex${infix}-${value}-1`); + } + } + }); + + test('flex-order classes', () => { + for (const infix of INFIXES) { + expect(css).toContain(`.ion-order${infix}-first`); + expect(css).toContain(`.ion-order${infix}-last`); + for (let i = 0; i <= 12; i++) { + expect(css).toContain(`.ion-order${infix}-${i}`); + } + } + }); +});