Skip to content

Commit e5a54ae

Browse files
test(accordion): update nested test
1 parent d67d6e5 commit e5a54ae

File tree

1 file changed

+1
-122
lines changed

1 file changed

+1
-122
lines changed
Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test } from '@utils/test/playwright';
33

4-
configs({ directions: ['ltr'] }).forEach(({ config, screenshot, title }) => {
4+
configs({ directions: ['ltr'], modes: ['md', 'ios', 'ionic-md'] }).forEach(({ config, screenshot, title }) => {
55
test.describe(title('accordion: nested'), () => {
66
test('parent and child should not be disabled', async ({ page }) => {
77
await page.goto(`/src/components/accordion/test/nested`, config);
@@ -28,124 +28,3 @@ configs({ directions: ['ltr'] }).forEach(({ config, screenshot, title }) => {
2828
});
2929
});
3030
});
31-
32-
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
33-
test.describe(title('accordion: nested'), () => {
34-
test('parent and child should not be disabled', async ({ page }) => {
35-
await page.setContent(
36-
`
37-
<ion-accordion-group value="first">
38-
<ion-accordion value="first">
39-
<ion-item slot="header">
40-
<ion-label>Attractions</ion-label>
41-
</ion-item>
42-
<ion-accordion-group slot="content" value="second">
43-
<ion-accordion value="first">
44-
<ion-item slot="header">
45-
<ion-label>First Item</ion-label>
46-
</ion-item>
47-
<div slot="content">First item content!</div>
48-
</ion-accordion>
49-
<ion-accordion value="second">
50-
<ion-item slot="header">
51-
<ion-label>Second Item</ion-label>
52-
</ion-item>
53-
<div slot="content">Second item content!</div>
54-
</ion-accordion>
55-
<ion-accordion value="third">
56-
<ion-item slot="header">
57-
<ion-label>Third Item</ion-label>
58-
</ion-item>
59-
<div slot="content">Third item content!</div>
60-
</ion-accordion>
61-
</ion-accordion-group>
62-
</ion-accordion>
63-
</ion-accordion-group>
64-
`,
65-
config
66-
);
67-
68-
const accordionGroup = page.locator('ion-accordion-group');
69-
70-
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-nested-enabled'));
71-
});
72-
73-
test('parent should not be disabled when only child is disabled', async ({ page }) => {
74-
await page.setContent(
75-
`
76-
<ion-accordion-group value="first">
77-
<ion-accordion value="first">
78-
<ion-item slot="header">
79-
<ion-label>Attractions</ion-label>
80-
</ion-item>
81-
<ion-accordion-group slot="content" value="second" disabled="true">
82-
<ion-accordion value="first">
83-
<ion-item slot="header">
84-
<ion-label>First Item</ion-label>
85-
</ion-item>
86-
<div slot="content">First item content!</div>
87-
</ion-accordion>
88-
<ion-accordion value="second">
89-
<ion-item slot="header">
90-
<ion-label>Second Item</ion-label>
91-
</ion-item>
92-
<div slot="content">Second item content!</div>
93-
</ion-accordion>
94-
<ion-accordion value="third">
95-
<ion-item slot="header">
96-
<ion-label>Third Item</ion-label>
97-
</ion-item>
98-
<div slot="content">Third item content!</div>
99-
</ion-accordion>
100-
</ion-accordion-group>
101-
</ion-accordion>
102-
</ion-accordion-group>
103-
`,
104-
config
105-
);
106-
107-
const accordionGroup = page.locator('ion-accordion-group');
108-
109-
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-child-disabled'));
110-
});
111-
112-
test('parent and child should be disabled when parent is disabled', async ({ page }) => {
113-
await page.setContent(
114-
`
115-
<ion-accordion-group value="first" disabled="true">
116-
<ion-accordion value="first">
117-
<ion-item slot="header">
118-
<ion-label>Attractions</ion-label>
119-
</ion-item>
120-
<ion-accordion-group slot="content" value="second">
121-
<ion-accordion value="first">
122-
<ion-item slot="header">
123-
<ion-label>First Item</ion-label>
124-
</ion-item>
125-
<div slot="content">First item content!</div>
126-
</ion-accordion>
127-
<ion-accordion value="second">
128-
<ion-item slot="header">
129-
<ion-label>Second Item</ion-label>
130-
</ion-item>
131-
<div slot="content">Second item content!</div>
132-
</ion-accordion>
133-
<ion-accordion value="third">
134-
<ion-item slot="header">
135-
<ion-label>Third Item</ion-label>
136-
</ion-item>
137-
<div slot="content">Third item content!</div>
138-
</ion-accordion>
139-
</ion-accordion-group>
140-
</ion-accordion>
141-
</ion-accordion-group>
142-
`,
143-
config
144-
);
145-
146-
const accordionGroup = page.locator('ion-accordion-group');
147-
148-
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-parent-disabled'));
149-
});
150-
});
151-
});

0 commit comments

Comments
 (0)