Skip to content

Commit 2e7f913

Browse files
committed
add another edge-case
1 parent 48d58d2 commit 2e7f913

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/page/expect-misc.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ test.describe('toHaveClass', () => {
234234
await expect(locator).toHaveClass(' bar foo ', { partial: true });
235235
await expect(locator).not.toHaveClass('does-not-exist', { partial: true });
236236
await expect(locator).not.toHaveClass(' baz foo ', { partial: true }); // Strip whitespace and match individual classes
237+
238+
await page.setContent('<div class="foo bar baz"></div>');
239+
await expect(locator).toHaveClass('foo bar', { partial: true });
240+
await expect(locator).toHaveClass('', { partial: true });
237241
});
238242

239243
test('allow matching partial class names with array', async ({ page }) => {

0 commit comments

Comments
 (0)