-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cb/karma-webdriverio-replace
- Loading branch information
Showing
16 changed files
with
224 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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,37 @@ | ||
import { createPuppeteerScreenshotOptions } from '../puppeteer-screenshot'; | ||
|
||
describe('Puppeteer Screenshot', () => { | ||
describe('createPuppeteerScreenshotOptions', () => { | ||
it('should use the viewport width and height by default', () => { | ||
const options = createPuppeteerScreenshotOptions({}, { width: 800, height: 600 }); | ||
|
||
expect(options.clip).toEqual({ | ||
x: 0, | ||
y: 0, | ||
width: 800, | ||
height: 600, | ||
}); | ||
}); | ||
|
||
it('should use clip options if provided', () => { | ||
const options = createPuppeteerScreenshotOptions( | ||
{ | ||
clip: { | ||
x: 10, | ||
y: 20, | ||
width: 100, | ||
height: 200, | ||
}, | ||
}, | ||
{ width: 800, height: 600 }, | ||
); | ||
|
||
expect(options.clip).toEqual({ | ||
x: 10, | ||
y: 20, | ||
width: 100, | ||
height: 200, | ||
}); | ||
}); | ||
}); | ||
}); |
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
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,24 @@ | ||
import { Component, Element, h, Host } from '@stencil/core'; | ||
|
||
@Component({ | ||
tag: 'slot-ref', | ||
shadow: false, | ||
scoped: true, | ||
}) | ||
export class SlotRef { | ||
@Element() hostElement: HTMLElement; | ||
|
||
render() { | ||
return ( | ||
<Host> | ||
<slot | ||
name="title" | ||
ref={(el) => { | ||
this.hostElement.setAttribute('data-ref-id', el.id); | ||
this.hostElement.setAttribute('data-ref-tagname', el.tagName); | ||
}} | ||
/> | ||
</Host> | ||
); | ||
} | ||
} |
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,6 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf8"> | ||
<script src="./build/testapp.esm.js" type="module"></script> | ||
<script src="./build/testapp.js" nomodule></script> | ||
|
||
<slot-ref><span slot="title" id="slotted-element-id">Hello World!</span></slot-ref> |
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,19 @@ | ||
import { setupDomTests, waitForChanges } from '../util'; | ||
|
||
describe('slot-ref', function () { | ||
const { setupDom, tearDownDom } = setupDomTests(document); | ||
let app: HTMLElement; | ||
|
||
beforeEach(async () => { | ||
app = await setupDom('/slot-ref/index.html'); | ||
}); | ||
afterEach(tearDownDom); | ||
|
||
it('ref callback of slot is called', async () => { | ||
await waitForChanges(); | ||
|
||
const host = app.querySelector('slot-ref'); | ||
expect(host.getAttribute('data-ref-id')).toBe('slotted-element-id'); | ||
expect(host.getAttribute('data-ref-tagname')).toBe('SPAN'); | ||
}); | ||
}); |