-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(integration-karma): migrate slotted-custome-element-event-target
- Loading branch information
Showing
10 changed files
with
30 additions
and
45 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/integration-karma/test/events/slotted-custom-element-event-target/index.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { createElement } from 'test-utils'; | ||
import Container from 'x/container'; | ||
|
||
describe('Event target in slot elements', () => { | ||
it('should receive event with correct target in slotted custom element', function() { | ||
const elm = createElement('x-container', { is: Container }); | ||
document.body.appendChild(elm); | ||
|
||
const child = elm.shadowRoot.querySelector('x-child'); | ||
child.click(); | ||
|
||
return Promise.resolve().then(() => { | ||
const elementWithResult = elm.shadowRoot | ||
.querySelector('x-parent') | ||
.shadowRoot.querySelector('.correct-event-target'); | ||
|
||
expect(elementWithResult).not.toBeNull(); | ||
expect(elementWithResult.innerText).toBe('Event target is correct'); | ||
}); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...egration-karma/test/events/slotted-custom-element-event-target/x/container/container.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<x-parent> | ||
<x-child></x-child> | ||
</x-parent> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
...ntegration-karma/test/events/slotted-custom-element-event-target/x/container/container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LightningElement } from 'lwc'; | ||
|
||
export default class Container extends LightningElement {} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
.../integration/slotted-custom-element-event-target/slotted-custom-element-event-target.html
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...et/integration/slotted-custom-element-event-target/slotted-custom-element-event-target.js
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...ents/test-slotted-custom-element-event-target/slotted-custom-element-event-target.spec.js
This file was deleted.
Oops, something went wrong.