Skip to content

Conversation

@mxschmitt
Copy link
Contributor

This was previously added in #15491 but reverted. The difference to the previous implementation is that its not a separate expect matcher its rather just a new option partial: boolean which is by default false. This option works when passing a string and a string[].

Relates #14117

@mxschmitt mxschmitt force-pushed the toHaveClass-partial branch from b5d4889 to 395db83 Compare March 17, 2025 11:48
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the toHaveClass-partial branch from 395db83 to adc3ded Compare March 17, 2025 12:53
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the toHaveClass-partial branch 2 times, most recently from 7d89bc5 to 0a73c70 Compare March 19, 2025 10:28
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.


Expected class or RegExp or a list of those.

### option: LocatorAssertions.toHaveClass.partial
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A topic for the API review: does not.toHaveClass('foo bar', { partial: true }) match the class name foo baz?

@mxschmitt mxschmitt force-pushed the toHaveClass-partial branch from 0a73c70 to 48d58d2 Compare March 20, 2025 19:16
@github-actions

This comment has been minimized.

@mxschmitt mxschmitt merged commit fbffb81 into microsoft:main Mar 20, 2025
29 checks passed
@mxschmitt mxschmitt deleted the toHaveClass-partial branch March 20, 2025 20:20
@github-actions
Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node18-1
⚠️ [webkit-page] › tests/page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18

38797 passed, 808 skipped
✔️✔️✔️

Merge workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants