-
Notifications
You must be signed in to change notification settings - Fork 11
Remove wp-show
and wp-text
directives
#220
Changes from all commits
1a79d0f
f455cc7
aaffee3
79bce9e
56c756e
6f617d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,9 @@ test.describe('toVdom - isands', () => { | |
await expect(el).toBeVisible(); | ||
}); | ||
|
||
test('directives inside islands should not be hydrated twice', async ({ | ||
// TODO: Implement this test once we have data-wp-init: | ||
// https://github.com/WordPress/block-interactivity-experiments/pull/220#discussion_r1171417552 | ||
test.skip('directives inside islands should not be hydrated twice', async ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I skipped this one because I didn't see clearly how to refactor this test without using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove this test for now, although I would prefer to have this case covered. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can do something like this: <div data-wp-island>
<div data-wp-island>
<div data-testid="island inside another island">
<div data-wp-init="actions.appendText">
<span>
This should not have two spans appended because that means we hydrated
twice.
</span>
</div>
</div>
</div>
</div> appendText: ({ ref }) => {
const span = document.createTextNode("Span");
span.innerText = "some text";
ref.appendChild(span);
}; And check that there's only one span or something similar. But I think |
||
page, | ||
}) => { | ||
const el = page.getByTestId('island inside another island'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a
state.trueValue
as well if you prefer.