mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-28 17:44:33 +03:00
chore: perform e2e rebase test (#33390)
This commit is contained in:
parent
3b4b8f9e49
commit
fc0ce7046b
@ -48,3 +48,14 @@ test('setExpanded is called', async ({ mount }) => {
|
||||
await component.getByText('Title').click();
|
||||
expect(expandedValues).toEqual([true]);
|
||||
});
|
||||
|
||||
test('setExpanded should work', async ({ mount }) => {
|
||||
const component = await mount(<AutoChip header='Title' initialExpanded={false}>
|
||||
Body
|
||||
</AutoChip>);
|
||||
await component.getByText('Title').click();
|
||||
await expect(component).toMatchAriaSnapshot(`
|
||||
- button "Title" [expanded]
|
||||
- region: Body
|
||||
`);
|
||||
});
|
||||
|
@ -32,6 +32,8 @@ export const Chip: React.FC<{
|
||||
}> = ({ header, expanded, setExpanded, children, noInsets, dataTestId, targetRef }) => {
|
||||
return <div className='chip' data-testid={dataTestId} ref={targetRef}>
|
||||
<div
|
||||
role='button'
|
||||
aria-expanded={!!expanded}
|
||||
className={clsx('chip-header', setExpanded && ' expanded-' + expanded)}
|
||||
onClick={() => setExpanded?.(!expanded)}
|
||||
title={typeof header === 'string' ? header : undefined}>
|
||||
@ -39,7 +41,7 @@ export const Chip: React.FC<{
|
||||
{setExpanded && !expanded && icons.rightArrow()}
|
||||
{header}
|
||||
</div>
|
||||
{(!setExpanded || expanded) && <div className={clsx('chip-body', noInsets && 'chip-body-no-insets')}>{children}</div>}
|
||||
{(!setExpanded || expanded) && <div role='region' className={clsx('chip-body', noInsets && 'chip-body-no-insets')}>{children}</div>}
|
||||
</div>;
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { test, expect, playwrightCtConfigText } from './playwright-test-fixtures';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
@ -47,6 +48,10 @@ test('should update snapshot with the update-snapshots flag', async ({ runInline
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should update missing snapshots', async ({ runInlineTest }, testInfo) => {
|
||||
@ -76,6 +81,10 @@ test('should update missing snapshots', async ({ runInlineTest }, testInfo) => {
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should generate baseline with regex', async ({ runInlineTest }, testInfo) => {
|
||||
@ -126,6 +135,10 @@ test('should generate baseline with regex', async ({ runInlineTest }, testInfo)
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should generate baseline with special characters', async ({ runInlineTest }, testInfo) => {
|
||||
@ -168,6 +181,10 @@ test('should generate baseline with special characters', async ({ runInlineTest
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should update missing snapshots in tsx', async ({ runInlineTest }, testInfo) => {
|
||||
@ -207,6 +224,10 @@ test('should update missing snapshots in tsx', async ({ runInlineTest }, testInf
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should update multiple files', async ({ runInlineTest }, testInfo) => {
|
||||
@ -269,6 +290,10 @@ test('should update multiple files', async ({ runInlineTest }, testInfo) => {
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
||||
test('should generate baseline for input values', async ({ runInlineTest }, testInfo) => {
|
||||
@ -298,4 +323,8 @@ test('should generate baseline for input values', async ({ runInlineTest }, test
|
||||
});
|
||||
|
||||
`);
|
||||
|
||||
execSync(`patch -p1 < ${patchPath}`, { cwd: testInfo.outputPath() });
|
||||
const result2 = await runInlineTest({});
|
||||
expect(result2.exitCode).toBe(0);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user