Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .claude/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Jest unit/component tests are co-located in a component's `__tests__/` folder.

`.spec.tsx` specs use a table-driven pattern:

* Import `test` and `expect` from `tests/playwright`, never directly from
`@playwright/experimental-ct-react`; its `mount` moves the pointer out of the
viewport so components do not get into `:hover` state.
* Import arrays of test cases from `_propTests/` directories and from shared
`tests/playwright/propTests/`.
* Each test case is `{ name, props, onBeforeTest?, onBeforeSnapshot? }`; custom
Expand Down
4 changes: 2 additions & 2 deletions src/components/Alert/__tests__/Alert.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { AlertForTest } from './Alert.story';

test.describe('Alert', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Badge/__tests__/Badge.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import { BadgeForTest } from './Badge.story';
import { labelPropTest } from './_propTests/labelPropTest';
Expand Down
4 changes: 1 addition & 3 deletions src/components/Button/__tests__/Button.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import {
ButtonForRefTest,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions src/components/ButtonGroup/__tests__/ButtonGroup.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import {
ButtonGroupForTest,
Expand Down
4 changes: 1 addition & 3 deletions src/components/Card/__tests__/Card.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import {
CadForTest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { CheckboxForFormLayoutTestsProps } from './CheckboxField.story';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { FileInputFieldForFormLayoutTestsProps } from './FileInputField.story';
import {
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormLayout/__tests__/FormLayout.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
FormLayoutForTest,
FormLayoutWithoutChildrenForTest,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
} from '../../../../tests/playwright';
import { customFieldValidationStatesPropTest } from './_propTests/customFieldTests/customFieldValidationStatesPropTest';
import { customFieldLabelAlignmentPropTest } from './_propTests/customFieldTests/customFieldLabelAlignmentPropTest';
import { customFieldRequiredPropTest } from './_propTests/customFieldTests/customFieldRequiredPropTest';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/Grid/__tests__/Grid.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
GridForTest,
GridWithFixedCardsHeightForTest,
Expand Down
4 changes: 2 additions & 2 deletions src/components/InputGroup/__tests__/InputGroup.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
InputGroupForTest,
InputGroupWithCustomInputPropsForTest,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/Modal.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
ModalWithInputsForTest,
ModalForTest,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/ModalCloseButton.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
ModalCloseButtonForRefTest,
ModalCloseButtonForTest,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/ModalContent.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { contentPropTest } from './_propTests/contentPropTest';
import {
ModalContentForTest,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/ModalFooter.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { ModalFooterForTest } from './ModalFooter.story';
import { justifyPropTest } from './_propTests/justifyPropTest';

Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/ModalHeader.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { ModalHeaderForTest } from './ModalHeader.story';
import { justifyPropTest } from './_propTests/justifyPropTest';

Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/__tests__/ModalTitle.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { ModalTitleForTest } from './ModalTitle.story';
import { contentPropTest } from './_propTests/contentPropTest';

Expand Down
4 changes: 1 addition & 3 deletions src/components/Paper/__tests__/Paper.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import { PaperForTest } from './Paper.story';
import { mutedPropTest } from './_propTests/mutedPropTest';
Expand Down
4 changes: 2 additions & 2 deletions src/components/Popover/__tests__/Popover.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
PopoverForRefTest,
PopoverForTest,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Popover/__tests__/PopoverWrapper.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
} from '../../../../tests/playwright';
import { PopoverWrapperForTest } from './PopoverWrapper.story';

test.describe('PopoverWrapper', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Radio/__tests__/Radio.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import { partialDisabledOptionsPropTest } from './_propTests/partialDisabledOptionsPropTest';
import type { RadioForFormLayoutTestsProps } from './Radio.story';
Expand Down
4 changes: 1 addition & 3 deletions src/components/ScrollView/__tests__/ScrollView.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import {
ScrollViewForDetectEndAutoscrollTest,
Expand Down
4 changes: 1 addition & 3 deletions src/components/SelectField/__tests__/SelectField.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { SelectFieldForFormLayoutTestsProps } from './SelectField.story';
import {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/Table/__tests__/Table.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { TableForTest } from './Table.story';
import { sortPropTest } from './_propTests/sortPropTest';

Expand Down
4 changes: 1 addition & 3 deletions src/components/Tabs/__tests__/TabItem.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
propTests,
mixPropTests,
test,
} from '../../../../tests/playwright';
import { TabItemForTest } from './TabItem.story';
import { isActivePropTest } from './_propTests/tabItem/isActivePropTest';
Expand Down
4 changes: 1 addition & 3 deletions src/components/Tabs/__tests__/Tabs.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
getActualFocusedElementText,
propTests,
test,
} from '../../../../tests/playwright';
import { TabsForTest } from './Tabs.story';

Expand Down
4 changes: 2 additions & 2 deletions src/components/Text/__tests__/Text.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import {
TextForRenderTest,
TextForTest,
Expand Down
4 changes: 1 addition & 3 deletions src/components/TextArea/__tests__/TextArea.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { TextAreaForFormLayoutTestsProps } from './TextArea.story';
import {
Expand Down
4 changes: 1 addition & 3 deletions src/components/TextField/__tests__/TextField.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { TextFieldForFormLayoutTestsProps } from './TextField.story';
import {
Expand Down
4 changes: 2 additions & 2 deletions src/components/TextLink/__tests__/TextLink.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import {
expect,
propTests,
test,
} from '@playwright/experimental-ct-react';
import { propTests } from '../../../../tests/playwright';
} from '../../../../tests/playwright';
import { TextLinkForTest } from './TextLink.story';

test.describe('TextLink', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Toggle/__tests__/Toggle.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import {
expect,
test,
} from '@playwright/experimental-ct-react';
import {
mixPropTests,
propTests,
test,
} from '../../../../tests/playwright';
import type { ToggleForFormLayoutTestsProps } from './Toggle.story';
import {
Expand Down
Loading
Loading