Skip to content

Commit 3e493ba

Browse files
Adds UnderlinePanels to drafts/ (#4550)
* adds UnderlinePanels components and stories stylistic tweaks more stylistic tweaks * adds tests, minor stylistic updates * adds component docs * adds changeset * corrects changeset * fixes circ dep, tests, misc bugs * more test fixes * appease the linter * updates snaps, fixes tiny visual regression * test(vrt): update snapshots * cleanup * upgrades @github/tab-container-element * fixes createComponent import * updates jest snapshots * Apply suggestion from @broccolinisoup Co-authored-by: Armağan <[email protected]> * addresses PR feedback * fix broken import * addresses more PR feedback * test(vrt): update snapshots * test(vrt): update snapshots * adds fallbacks to CSS vars * fixes CSS typo * fixes more typos --------- Co-authored-by: mperrotti <[email protected]> Co-authored-by: Armağan <[email protected]>
1 parent 3c467ef commit 3e493ba

File tree

170 files changed

+4272
-10280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+4272
-10280
lines changed

.changeset/rotten-apples-hope.md

Lines changed: 7 additions & 0 deletions
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
import {test, expect} from '@playwright/test'
2+
import {visit} from '../test-helpers/storybook'
3+
import {themes} from '../test-helpers/themes'
4+
5+
test.describe('UnderlinePanels', () => {
6+
test.describe('Default', () => {
7+
for (const theme of themes) {
8+
test.describe(theme, () => {
9+
test('default @vrt', async ({page}) => {
10+
await visit(page, {
11+
id: 'drafts-components-underlinepanels--default',
12+
globals: {
13+
colorScheme: theme,
14+
},
15+
})
16+
17+
// Default state
18+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Default.${theme}.png`)
19+
})
20+
21+
test('axe @aat', async ({page}) => {
22+
await visit(page, {
23+
id: 'drafts-components-underlinepanels--default',
24+
globals: {
25+
colorScheme: theme,
26+
},
27+
})
28+
await expect(page).toHaveNoViolations({
29+
rules: {
30+
'color-contrast': {
31+
enabled: theme !== 'dark_dimmed',
32+
},
33+
},
34+
})
35+
})
36+
})
37+
}
38+
})
39+
40+
test.describe('Labelled By External Element', () => {
41+
for (const theme of themes) {
42+
test.describe(theme, () => {
43+
test('default @vrt', async ({page}) => {
44+
await visit(page, {
45+
id: 'drafts-components-underlinepanels-features--labelled-by-external-element',
46+
globals: {
47+
colorScheme: theme,
48+
},
49+
})
50+
51+
// Default state
52+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Labelled By External Element.${theme}.png`)
53+
})
54+
55+
test('axe @aat', async ({page}) => {
56+
await visit(page, {
57+
id: 'drafts-components-underlinepanels-features--labelled-by-external-element',
58+
globals: {
59+
colorScheme: theme,
60+
},
61+
})
62+
await expect(page).toHaveNoViolations({
63+
rules: {
64+
'color-contrast': {
65+
enabled: theme !== 'dark_dimmed',
66+
},
67+
},
68+
})
69+
})
70+
})
71+
}
72+
})
73+
74+
test.describe('Selected Tab', () => {
75+
for (const theme of themes) {
76+
test.describe(theme, () => {
77+
test('default @vrt', async ({page}) => {
78+
await visit(page, {
79+
id: 'drafts-components-underlinepanels-features--selected-tab',
80+
globals: {
81+
colorScheme: theme,
82+
},
83+
})
84+
85+
// Default state
86+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Selected Tab.${theme}.png`)
87+
})
88+
89+
test('axe @aat', async ({page}) => {
90+
await visit(page, {
91+
id: 'drafts-components-underlinepanels-features--selected-tab',
92+
globals: {
93+
colorScheme: theme,
94+
},
95+
})
96+
await expect(page).toHaveNoViolations({
97+
rules: {
98+
'color-contrast': {
99+
enabled: theme !== 'dark_dimmed',
100+
},
101+
},
102+
})
103+
})
104+
})
105+
}
106+
})
107+
108+
test.describe('With Counters', () => {
109+
for (const theme of themes) {
110+
test.describe(theme, () => {
111+
test('default @vrt', async ({page}) => {
112+
await visit(page, {
113+
id: 'drafts-components-underlinepanels-features--with-counters',
114+
globals: {
115+
colorScheme: theme,
116+
},
117+
})
118+
119+
// Default state
120+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Counters.${theme}.png`)
121+
})
122+
123+
test('axe @aat', async ({page}) => {
124+
await visit(page, {
125+
id: 'drafts-components-underlinepanels-features--with-counters',
126+
globals: {
127+
colorScheme: theme,
128+
},
129+
})
130+
await expect(page).toHaveNoViolations({
131+
rules: {
132+
'color-contrast': {
133+
enabled: theme !== 'dark_dimmed',
134+
},
135+
},
136+
})
137+
})
138+
})
139+
}
140+
})
141+
142+
test.describe('With Counters In Loading State', () => {
143+
for (const theme of themes) {
144+
test.describe(theme, () => {
145+
test('default @vrt', async ({page}) => {
146+
await visit(page, {
147+
id: 'drafts-components-underlinepanels-features--with-counters-in-loading-state',
148+
globals: {
149+
colorScheme: theme,
150+
},
151+
})
152+
153+
// Default state
154+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Counters In Loading State.${theme}.png`)
155+
})
156+
157+
test('axe @aat', async ({page}) => {
158+
await visit(page, {
159+
id: 'drafts-components-underlinepanels-features--with-counters-in-loading-state',
160+
globals: {
161+
colorScheme: theme,
162+
},
163+
})
164+
await expect(page).toHaveNoViolations({
165+
rules: {
166+
'color-contrast': {
167+
enabled: theme !== 'dark_dimmed',
168+
},
169+
},
170+
})
171+
})
172+
})
173+
}
174+
})
175+
176+
test.describe('With Icons', () => {
177+
for (const theme of themes) {
178+
test.describe(theme, () => {
179+
test('default @vrt', async ({page}) => {
180+
await visit(page, {
181+
id: 'drafts-components-underlinepanels-features--with-icons',
182+
globals: {
183+
colorScheme: theme,
184+
},
185+
})
186+
187+
// Default state
188+
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Icons.${theme}.png`)
189+
})
190+
191+
test('axe @aat', async ({page}) => {
192+
await visit(page, {
193+
id: 'drafts-components-underlinepanels-features--with-icons',
194+
globals: {
195+
colorScheme: theme,
196+
},
197+
})
198+
await expect(page).toHaveNoViolations({
199+
rules: {
200+
'color-contrast': {
201+
enabled: theme !== 'dark_dimmed',
202+
},
203+
},
204+
})
205+
})
206+
})
207+
}
208+
})
209+
210+
test.describe('With Icons Hidden On Narrow Screen', () => {
211+
for (const theme of themes) {
212+
test.describe(theme, () => {
213+
test('default @vrt', async ({page}) => {
214+
await visit(page, {
215+
id: 'drafts-components-underlinepanels-features--with-icons-hidden-on-narrow-screen',
216+
globals: {
217+
colorScheme: theme,
218+
},
219+
})
220+
221+
// Default state
222+
expect(await page.screenshot()).toMatchSnapshot(
223+
`UnderlineNav.With Icons Hidden On Narrow Screen.${theme}.png`,
224+
)
225+
})
226+
227+
test('axe @aat', async ({page}) => {
228+
await visit(page, {
229+
id: 'drafts-components-underlinepanels-features--with-icons-hidden-on-narrow-screen',
230+
globals: {
231+
colorScheme: theme,
232+
},
233+
})
234+
await expect(page).toHaveNoViolations({
235+
rules: {
236+
'color-contrast': {
237+
enabled: theme !== 'dark_dimmed',
238+
},
239+
},
240+
})
241+
})
242+
})
243+
}
244+
})
245+
})

0 commit comments

Comments
 (0)