@spectrum-web-components/overlay 0.41.2 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -7
- package/src/HoverController.dev.js +8 -1
- package/src/HoverController.dev.js.map +2 -2
- package/src/HoverController.js +1 -1
- package/src/HoverController.js.map +3 -3
- package/src/OverlayStack.d.ts +1 -1
- package/src/OverlayStack.dev.js +8 -1
- package/src/OverlayStack.dev.js.map +2 -2
- package/src/OverlayStack.js +1 -1
- package/src/OverlayStack.js.map +3 -3
- package/src/overlay-trigger-directive.d.ts +3 -8
- package/src/overlay-trigger-directive.dev.js +7 -33
- package/src/overlay-trigger-directive.dev.js.map +2 -2
- package/src/overlay-trigger-directive.js +1 -1
- package/src/overlay-trigger-directive.js.map +3 -3
- package/src/slottable-request-directive.d.ts +17 -0
- package/src/slottable-request-directive.dev.js +63 -0
- package/src/slottable-request-directive.dev.js.map +7 -0
- package/src/slottable-request-directive.js +2 -0
- package/src/slottable-request-directive.js.map +7 -0
- package/src/slottable-request-event.d.ts +5 -0
- package/src/slottable-request-event.dev.js.map +1 -1
- package/src/slottable-request-event.js.map +1 -1
- package/stories/overlay-directive.stories.js +36 -7
- package/stories/overlay-directive.stories.js.map +3 -3
- package/stories/overlay-element.stories.js +2 -2
- package/stories/overlay-element.stories.js.map +1 -1
- package/stories/overlay-story-components.js +1 -1
- package/stories/overlay-story-components.js.map +1 -1
- package/stories/overlay.stories.js +12 -24
- package/stories/overlay.stories.js.map +2 -2
- package/test/benchmark/directive-test.js +29 -28
- package/test/benchmark/directive-test.js.map +2 -2
- package/test/benchmark/lazy-test.js +6 -7
- package/test/benchmark/lazy-test.js.map +2 -2
- package/test/overlay-directive.test.js +17 -5
- package/test/overlay-directive.test.js.map +2 -2
- package/test/overlay-element.test.js +0 -3
- package/test/overlay-element.test.js.map +2 -2
- package/test/overlay-lifecycle.test.js +11 -4
- package/test/overlay-lifecycle.test.js.map +2 -2
- package/test/overlay-trigger-hover-click.test.js +17 -4
- package/test/overlay-trigger-hover-click.test.js.map +2 -2
- package/test/overlay-trigger-longpress.test.js +6 -1
- package/test/overlay-trigger-longpress.test.js.map +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import "@spectrum-web-components/tooltip/sp-tooltip.js";
|
|
3
2
|
import { html } from "@spectrum-web-components/base";
|
|
4
3
|
import {
|
|
5
4
|
elementUpdated,
|
|
@@ -8,17 +7,30 @@ import {
|
|
|
8
7
|
oneEvent,
|
|
9
8
|
waitUntil
|
|
10
9
|
} from "@open-wc/testing";
|
|
11
|
-
import "
|
|
12
|
-
import { elsewhere } from "../stories/overlay-directive.stories.js";
|
|
10
|
+
import { Default, insertionOptions } from "../stories/overlay-directive.stories.js";
|
|
13
11
|
import { sendMouse } from "../../../test/plugins/browser.js";
|
|
14
12
|
import { fixture } from "../../../test/testing-helpers.js";
|
|
15
13
|
describe("Overlay Directive", () => {
|
|
14
|
+
it("opens declaratively", async function() {
|
|
15
|
+
const test = await fixture(Default({ open: true }));
|
|
16
|
+
await oneEvent(test, "sp-opened");
|
|
17
|
+
const el = test.nextElementSibling;
|
|
18
|
+
expect(el.open).to.be.true;
|
|
19
|
+
});
|
|
20
|
+
it("opens without options", async function() {
|
|
21
|
+
const test = await fixture(Default());
|
|
22
|
+
const opened = oneEvent(test, "sp-opened");
|
|
23
|
+
test.click();
|
|
24
|
+
await opened;
|
|
25
|
+
const el = test.nextElementSibling;
|
|
26
|
+
expect(el.open).to.be.true;
|
|
27
|
+
});
|
|
16
28
|
it("opens an Overlay after the trigger", async function() {
|
|
17
29
|
const test = await fixture(html`
|
|
18
30
|
<div
|
|
19
31
|
style="width: 100%; height: 100vh; display: grid; place-content: center;"
|
|
20
32
|
>
|
|
21
|
-
${
|
|
33
|
+
${insertionOptions()}
|
|
22
34
|
</div>
|
|
23
35
|
`);
|
|
24
36
|
const el = test.querySelector("sp-button");
|
|
@@ -86,7 +98,7 @@ describe("Overlay Directive", () => {
|
|
|
86
98
|
<div
|
|
87
99
|
style="width: 100%; height: 100vh; display: grid; place-content: center;"
|
|
88
100
|
>
|
|
89
|
-
${
|
|
101
|
+
${insertionOptions(insertionOptions.args)}
|
|
90
102
|
</div>
|
|
91
103
|
`);
|
|
92
104
|
const el = test.querySelector("sp-button");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-directive.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport
|
|
5
|
-
"mappings": ";AAYA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html } from '@spectrum-web-components/base';\nimport {\n elementUpdated,\n expect,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport { Button } from '@spectrum-web-components/button';\nimport { Overlay } from '@spectrum-web-components/overlay';\nimport { Default, insertionOptions } from '../stories/overlay-directive.stories.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { fixture } from '../../../test/testing-helpers.js';\n\ndescribe('Overlay Directive', () => {\n it('opens declaratively', async function() {\n const test = await fixture<Button>(Default({ open: true }));\n await oneEvent(test, 'sp-opened');\n\n const el = test.nextElementSibling as Overlay;\n \n expect(el.open).to.be.true;\n });\n it('opens without options', async function() {\n const test = await fixture<Button>(Default());\n const opened = oneEvent(test, 'sp-opened');\n test.click();\n await opened;\n\n const el = test.nextElementSibling as Overlay;\n \n expect(el.open).to.be.true;\n });\n it('opens an Overlay after the trigger', async function () {\n const test = await fixture<HTMLElement>(html`\n <div\n style=\"width: 100%; height: 100vh; display: grid; place-content: center;\"\n >\n ${insertionOptions()}\n </div>\n `);\n\n const el = test.querySelector('sp-button') as Button;\n\n await elementUpdated(el);\n let overlays = document.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n\n const rect = el.getBoundingClientRect();\n let opened = oneEvent(el, 'sp-opened');\n // Open the Tooltip via \"hover\"\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n opened = oneEvent(el, 'sp-opened');\n // Open the Popover via \"click\"\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n {\n type: 'move',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n overlays = document.querySelectorAll('sp-overlay');\n expect(overlays.length).to.be.gt(0);\n expect(overlays[0].previousElementSibling).to.equal(el);\n\n // `slottable-request` comes _after_ `sp-closed` and triggers DOM cleanup\n const closed = oneEvent(overlays[0], 'slottable-request');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n await waitUntil(() => {\n overlays = document.querySelectorAll('sp-overlay');\n return overlays.length === 0;\n }, 'not all overlays were cleaned up');\n\n expect(overlays.length).to.equal(0);\n });\n\n it('opens an Overlay in a specific part of the DOM', async function () {\n const test = await fixture<HTMLElement>(html`\n <div\n style=\"width: 100%; height: 100vh; display: grid; place-content: center;\"\n >\n ${insertionOptions(insertionOptions.args)}\n </div>\n `);\n\n const el = test.querySelector('sp-button') as Button;\n\n await elementUpdated(el);\n\n const otherElement = test.querySelector(\n '#other-element'\n ) as HTMLElement;\n let overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n\n const rect = el.getBoundingClientRect();\n let opened = oneEvent(el, 'sp-opened');\n // Open the Tooltip via \"hover\"\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n opened = oneEvent(el, 'sp-opened');\n // Open the Popover via \"click\"\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left + rect.width / 2,\n rect.top + rect.height / 2,\n ],\n },\n ],\n });\n await opened;\n\n overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(1);\n\n // `slottable-request` comes _after_ `sp-closed` and triggers DOM cleanup\n const closed = oneEvent(overlays[0], 'slottable-request');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n rect.left - rect.width / 2,\n rect.top - rect.height / 2,\n ],\n },\n ],\n });\n await closed;\n\n // Wait for DOM clean up to complete\n await nextFrame();\n await nextFrame();\n\n overlays = otherElement.querySelectorAll('sp-overlay');\n expect(overlays.length).to.equal(0);\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAAY;AACrB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,SAAS,wBAAwB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AAExB,SAAS,qBAAqB,MAAM;AAChC,KAAG,uBAAuB,iBAAiB;AACvC,UAAM,OAAO,MAAM,QAAgB,QAAQ,EAAE,MAAM,KAAK,CAAC,CAAC;AAC1D,UAAM,SAAS,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;AAAA,IACJ,CAAC;AACD,UAAM;AAEN,aAAS,SAAS,IAAI,WAAW;AAEjC,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAEN,eAAW,aAAa,iBAAiB,YAAY;AACrD,WAAO,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;AAGlC,UAAM,SAAS,SAAS,SAAS,CAAC,GAAG,mBAAmB;AACxD,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,MAAM;AAAA,UACN,UAAU;AAAA,YACN,KAAK,OAAO,KAAK,QAAQ;AAAA,YACzB,KAAK,MAAM,KAAK,SAAS;AAAA,UAC7B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AACD,UAAM;AAGN,UAAM,UAAU;AAChB,UAAM,UAAU;AAEhB,eAAW,aAAa,iBAAiB,YAAY;AACrD,WAAO,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,EACtC,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -54,7 +54,6 @@ describe("sp-overlay", () => {
|
|
|
54
54
|
}
|
|
55
55
|
describe("`slottable-request` event", () => {
|
|
56
56
|
it("dispatched before `sp-opened`", async function() {
|
|
57
|
-
this.retries(0);
|
|
58
57
|
let slottableRequestTime = 0;
|
|
59
58
|
let openedTime = 0;
|
|
60
59
|
const el = await fixture(html`
|
|
@@ -72,7 +71,6 @@ describe("sp-overlay", () => {
|
|
|
72
71
|
expect(slottableRequestTime).to.be.lt(openedTime);
|
|
73
72
|
});
|
|
74
73
|
it("dispatched after `sp-closed`", async function() {
|
|
75
|
-
this.retries(0);
|
|
76
74
|
let slottableRequestTime = 0;
|
|
77
75
|
let closedTime = 0;
|
|
78
76
|
const el = await fixture(html`
|
|
@@ -100,7 +98,6 @@ describe("sp-overlay", () => {
|
|
|
100
98
|
).to.be.gt(closedTime);
|
|
101
99
|
});
|
|
102
100
|
it("follows transition timing from lazily added children", async function() {
|
|
103
|
-
this.retries(0);
|
|
104
101
|
let slottableRequestTime = 0;
|
|
105
102
|
let openedTime = 0;
|
|
106
103
|
const popover = document.createElement("sp-popover");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-element.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from '../src/slottable-request-event.js';\nimport { stub } from 'sinon';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('`slottable-request` event', () => {\n it('dispatched before `sp-opened`', async function () {\n this.retries(0);\n let slottableRequestTime = 0;\n let openedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n @sp-opened=${() => (openedTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lt(openedTime);\n });\n it('dispatched after `sp-closed`', async function () {\n this.retries(0);\n let slottableRequestTime = 0;\n let closedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @sp-closed=${() => (closedTime = performance.now())}\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n await nextFrame();\n await nextFrame();\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n await nextFrame();\n await nextFrame();\n\n expect(\n slottableRequestTime,\n `slottable-request: ${slottableRequestTime}, sp-closed: ${closedTime}`\n ).to.be.gt(closedTime);\n });\n it('follows transition timing from lazily added children', async function () {\n this.retries(0);\n let slottableRequestTime = 0;\n let openedTime = 0;\n const popover = document.createElement('sp-popover');\n popover.textContent = 'Test';\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${(event: SlottableRequestEvent) => {\n slottableRequestTime = performance.now();\n if (event.data !== removeSlottableRequest) {\n (event.target as HTMLElement).append(popover);\n } else {\n popover.remove();\n }\n }}\n @sp-opened=${() => (openedTime = performance.now())}\n ></sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lte(openedTime);\n expect(openedTime - slottableRequestTime).to.be.gt(130);\n });\n\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `slottable-request` events are experimental', async () => {\n const el = await fixture<Overlay>(html`\n <sp-overlay>\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes(\n '`slottable-request` events are experimental'\n ),\n '`slottable-request`-centric message'\n ).to.be.true;\n expect(\n spyCall.args.at(-1),\n 'confirm `data` shape'\n ).to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n });\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when manually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n it('does not close when pressing `Escape`', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,qBAAqB;AACrC;AAAA,EACI;AAAA,OAEG;AACP,SAAS,YAAY;AAErB,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAi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Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n} from '@open-wc/testing';\nimport { Overlay } from '@spectrum-web-components/overlay/src/Overlay.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Theme } from '@spectrum-web-components/theme';\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/theme/sp-theme.js';\nimport '@spectrum-web-components/theme/src/themes.js';\nimport '@spectrum-web-components/button/sp-button.js';\n\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { Button } from '@spectrum-web-components/button';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { click, receivesFocus } from '../stories/overlay-element.stories.js';\nimport {\n removeSlottableRequest,\n SlottableRequestEvent,\n} from '../src/slottable-request-event.js';\nimport { stub } from 'sinon';\n\nconst OVERLAY_TYPES = ['modal', 'page', 'hint', 'auto', 'manual'] as const;\ntype OverlayTypes = typeof OVERLAY_TYPES[number];\n\nasync function styledFixture<T extends Element>(\n story: TemplateResult\n): Promise<T> {\n const test = await fixture<Theme>(html`\n <sp-theme theme=\"spectrum\" scale=\"medium\" color=\"light\">\n ${story}\n </sp-theme>\n `);\n return test.children[0] as T;\n}\n\ndescribe('sp-overlay', () => {\n function opensDeclaratively(overlayType: OverlayTypes): void {\n it(`as [type=\"'${overlayType}'\"]`, async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay open type=${overlayType}>\n <sp-tooltip>Content</sp-tooltip>\n </sp-overlay>\n `);\n const content = el.children[0] as Tooltip;\n let opened = oneEvent(el, 'sp-opened');\n await opened;\n\n expect(content.open).to.be.true;\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n expect(content.open).to.be.false;\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(content.open).to.be.true;\n });\n }\n\n describe('`slottable-request` event', () => {\n it('dispatched before `sp-opened`', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n @sp-opened=${() => (openedTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lt(openedTime);\n });\n it('dispatched after `sp-closed`', async function () {\n let slottableRequestTime = 0;\n let closedTime = 0;\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @sp-closed=${() => (closedTime = performance.now())}\n @slottable-request=${() =>\n (slottableRequestTime = performance.now())}\n >\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n await nextFrame();\n await nextFrame();\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n await closed;\n\n await nextFrame();\n await nextFrame();\n\n expect(\n slottableRequestTime,\n `slottable-request: ${slottableRequestTime}, sp-closed: ${closedTime}`\n ).to.be.gt(closedTime);\n });\n it('follows transition timing from lazily added children', async function () {\n let slottableRequestTime = 0;\n let openedTime = 0;\n const popover = document.createElement('sp-popover');\n popover.textContent = 'Test';\n const el = await fixture<Overlay>(html`\n <sp-overlay\n @slottable-request=${(event: SlottableRequestEvent) => {\n slottableRequestTime = performance.now();\n if (event.data !== removeSlottableRequest) {\n (event.target as HTMLElement).append(popover);\n } else {\n popover.remove();\n }\n }}\n @sp-opened=${() => (openedTime = performance.now())}\n ></sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(slottableRequestTime).to.be.lte(openedTime);\n expect(openedTime - slottableRequestTime).to.be.gt(130);\n });\n\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `slottable-request` events are experimental', async () => {\n const el = await fixture<Overlay>(html`\n <sp-overlay>\n <sp-popover>test</sp-popover>\n </sp-overlay>\n `);\n\n await elementUpdated(el);\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes(\n '`slottable-request` events are experimental'\n ),\n '`slottable-request`-centric message'\n ).to.be.true;\n expect(\n spyCall.args.at(-1),\n 'confirm `data` shape'\n ).to.deep.equal({\n data: {\n localName: 'base',\n type: 'api',\n level: 'high',\n },\n });\n });\n });\n });\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.modal, 'sp-closed');\n this.modal.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.page, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.modal, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.modal.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.page, 'sp-closed');\n this.page.open = false;\n await closed;\n });\n it('closes \"page\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.modal, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.hint, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('closes \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.page, 'sp-opened');\n const closed = oneEvent(this.auto, 'sp-closed');\n this.page.open = true;\n await opened;\n await closed;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n it('does not close \"manual\" overlays when opening', async function () {\n let opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n\n opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n });\n it('ignores Escape key interactions', async () => {\n const el = await styledFixture<Overlay>(html`\n <sp-overlay type=\"page\">\n <sp-popover>This is a \"page\" Overlay</sp-popover>\n </sp-overlay>\n `);\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n await opened;\n\n expect(el.open).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await elementUpdated(el);\n\n expect(el.open).to.be.true;\n });\n });\n\n describe('[type=\"hint\"]', () => {\n opensDeclaratively('hint');\n\n it('closes other `[type=hint]` overlays when opening', async () => {\n const test = await styledFixture<Overlay>(html`\n <div>\n ${[1, 2].map(\n (overlay) => html`\n <sp-overlay type=\"hint\" class=\"hint-${overlay}\">\n <sp-tooltip>Hint ${overlay} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n const hint1 = test.querySelector('.hint-1') as Overlay;\n const hint2 = test.querySelector('.hint-2') as Overlay;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.false;\n\n let opened = oneEvent(hint1, 'sp-opened');\n hint1.open = true;\n await opened;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n\n opened = oneEvent(hint2, 'sp-opened');\n let closed = oneEvent(hint1, 'sp-closed');\n hint2.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.false;\n expect(hint2.open).to.be.true;\n\n opened = oneEvent(hint1, 'sp-opened');\n closed = oneEvent(hint2, 'sp-closed');\n hint1.open = true;\n await opened;\n await closed;\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n it('stays open when pointer enters overlay from trigger element', async () => {\n const test = await styledFixture(\n html`\n <div>\n <sp-button id=\"test-button\">\n This is a button.\n </sp-button>\n <sp-overlay\n trigger=\"test-button@hover\"\n type=\"hint\"\n placement=\"bottom\"\n offset=\"-10\"\n >\n <sp-tooltip>Help text.</sp-tooltip>\n </sp-overlay>\n </div>\n `\n );\n\n const button = test.querySelector('sp-button') as Button;\n const overlay = test.querySelector(\n 'sp-overlay'\n ) as unknown as Overlay;\n const el = test.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 2,\n ] as [number, number];\n\n await elementUpdated(overlay);\n\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await elementUpdated(overlay);\n // Allow the overlay process time to get started (we're not waiting for it to finish),\n // so that the next step can happen _while_ it opens.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height - 1,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height,\n ],\n },\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height + 1,\n ],\n },\n ],\n });\n // Give the Overlay some time to process what just happened.\n await nextFrame();\n await nextFrame();\n expect(overlay.open).to.be.true;\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n await elementUpdated(el);\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n });\n it('stays open when pointer enters overlay from trigger element: self managed', async () => {\n const button = await styledFixture(\n html`\n <sp-button>\n This is a button.\n <sp-tooltip self-managed placement=\"bottom\">\n Help text.\n </sp-tooltip>\n </sp-button>\n `\n );\n\n const el = button.querySelector('sp-tooltip') as Tooltip;\n const buttonRect = button.getBoundingClientRect();\n const buttonPoint = [\n buttonRect.x + buttonRect.width / 2,\n buttonRect.y + buttonRect.height / 2,\n ] as [number, number];\n\n await elementUpdated(el);\n // This test is possibly weird in its over simplicity for this contexts...\n await expect(button).to.be.accessible();\n // Pointer enter the button to trigger the tooltip\n let opened = oneEvent(button, 'sp-opened');\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // It takes this many frame for the overlay content to actual be queryable.\n // We're trying to do work _before_ `sp-opened` so it's a little tricky.\n // Is it possible to do this work _after_ `sp-opened` for more stability?\n // Try futzing with the `offset` values of the `sp-overlay`?\n await nextFrame();\n await nextFrame();\n await nextFrame();\n await nextFrame();\n const tooltipRect = (\n el.shadowRoot.querySelector('#tooltip') as HTMLDivElement\n ).getBoundingClientRect();\n const tooltipPoint = [\n tooltipRect.x + tooltipRect.width / 2,\n tooltipRect.y + tooltipRect.height / 2,\n ] as [number, number];\n // Pointer leave the button to close the tooltip, but...\n // Pointer enter the tooltip to keep the tooltip open\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: tooltipPoint,\n },\n ],\n });\n await opened;\n\n expect(el.open).to.be.true;\n await expect(button).to.be.accessible();\n\n let closed = oneEvent(button, 'sp-closed');\n // point enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n // pointer leave the button to close the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n\n expect(el.open).to.be.false;\n\n opened = oneEvent(button, 'sp-opened');\n // pointer enter the button to trigger the tooltip\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: buttonPoint,\n },\n ],\n });\n await opened;\n expect(el.open).to.be.true;\n\n closed = oneEvent(button, 'sp-closed');\n // pointer leave the button to close the tooltip\n sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n buttonRect.x + buttonRect.width * 2,\n buttonRect.y + buttonRect.height * 2,\n ] as [number, number],\n },\n ],\n });\n await closed;\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n it('receives focus', async () => {\n const test = await fixture(html`\n <div>${receivesFocus(receivesFocus.args)}</div>\n `);\n const trigger = test.querySelector('#trigger') as Button;\n const overlay = test.querySelector('a');\n\n expect(document.activeElement === overlay).to.be.false;\n\n const opened = oneEvent(trigger, 'sp-opened');\n trigger.click();\n await opened;\n\n expect(document.activeElement === overlay).to.be.true;\n });\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = await styledFixture<Overlay>(html`\n <div>\n ${OVERLAY_TYPES.map(\n (type) => html`\n <sp-overlay type=${type}>\n <sp-tooltip>${type} Content</sp-tooltip>\n </sp-overlay>\n `\n )}\n </div>\n `);\n\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as Overlay;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as Overlay;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as Overlay;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as Overlay;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as Overlay;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n });\n afterEach(async function () {\n const closed = oneEvent(this.manual, 'sp-closed');\n this.manual.open = false;\n await closed;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.modal, 'sp-opened');\n this.modal.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.true;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"modal\" overlays when opening', async function () {\n let opened = oneEvent(this.page, 'sp-opened');\n this.page.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.true;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"hint\" overlays when opening', async function () {\n let opened = oneEvent(this.hint, 'sp-opened');\n this.hint.open = true;\n await opened;\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.true;\n expect(this.auto.open).to.be.false;\n expect(this.manual.open).to.be.true;\n });\n it('does not close \"auto\" overlays when opening', async function () {\n let opened = oneEvent(this.auto, 'sp-opened');\n this.auto.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.false;\n\n opened = oneEvent(this.manual, 'sp-opened');\n this.manual.open = true;\n await opened;\n\n expect(this.modal.open).to.be.false;\n expect(this.page.open).to.be.false;\n expect(this.hint.open).to.be.false;\n expect(this.auto.open).to.be.true;\n expect(this.manual.open).to.be.true;\n });\n });\n describe('only close when manually closed', function () {\n it('does not close when clicking away', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [50, 400],\n },\n ],\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n it('does not close when pressing `Escape`', async () => {\n const test = await fixture(html`\n <div>\n ${click({\n ...click.args,\n interaction: 'click',\n placement: 'bottom',\n type: 'manual',\n delayed: false,\n receivesFocus: 'auto',\n })}\n </div>\n `);\n const el = test.querySelector('sp-overlay') as Overlay;\n\n expect(el.open).to.be.false;\n\n const opened = oneEvent(el, 'sp-opened');\n el.open = true;\n let { overlay } = await opened;\n expect(el === overlay).to.be.true;\n\n await sendKeys({\n press: 'Escape',\n });\n\n await aTimeout(200);\n\n expect(el.open).to.be.true;\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n ({ overlay } = await closed);\n expect(el === overlay).to.be.true;\n\n expect(el.open).to.be.false;\n });\n });\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AACP,OAAO;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,OAAO,qBAAqB;AACrC;AAAA,EACI;AAAA,OAEG;AACP,SAAS,YAAY;AAErB,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB,KAAK;AAAA;AAAA,KAEd;AACD,SAAO,KAAK,SAAS,CAAC;AAC1B;AAEA,SAAS,cAAc,MAAM;AACzB,WAAS,mBAAmB,aAAiC;AACzD,OAAG,cAAc,WAAW,OAAO,YAAY;AAC3C,YAAM,KAAK,MAAM,cAAuB;AAAA,wCACZ,WAAW;AAAA;AAAA;AAAA,aAGtC;AACD,YAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,UAAI,SAAS,SAAS,IAAI,WAAW;AACrC,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAC3B,YAAM,SAAS,SAAS,IAAI,WAAW;AACvC,SAAG,OAAO;AACV,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAC3B,eAAS,SAAS,IAAI,WAAW;AACjC,SAAG,OAAO;AACV,YAAM;AAEN,aAAO,QAAQ,IAAI,EAAE,GAAG,GAAG;AAAA,IAC/B,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,eAAe;AAAA,QACnB,CAAC,CAAC;AAAA;AAAA,iBAET;AACD,cAAM,KAAK,KAAK,cAAc,YAAY;AAE1C,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,YAAI,EAAE,QAAQ,IAAI,MAAM;AACxB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,cAAM,SAAS;AAAA,UACX,OAAO;AAAA,QACX,CAAC;AAED,cAAM,SAAS,GAAG;AAElB,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,cAAM,SAAS,SAAS,IAAI,WAAW;AACvC,WAAG,OAAO;AACV,SAAC,EAAE,QAAQ,IAAI,MAAM;AACrB,eAAO,OAAO,OAAO,EAAE,GAAG,GAAG;AAE7B,eAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAAA,MAC1B,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
import "@spectrum-web-components/tooltip/sp-tooltip.js";
|
|
12
12
|
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
13
13
|
import "@spectrum-web-components/overlay/overlay-trigger.js";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
a11ySnapshot,
|
|
16
|
+
findAccessibilityNode,
|
|
17
|
+
sendKeys
|
|
18
|
+
} from "@web/test-runner-commands";
|
|
15
19
|
describe("Overlay Trigger - accessible hover content management", () => {
|
|
16
20
|
it("accessibly describes trigger content with hover content", async () => {
|
|
17
21
|
const el = await fixture(html`
|
|
@@ -115,10 +119,13 @@ describe("Overlay Trigger - accessible hover content management", () => {
|
|
|
115
119
|
await elementUpdated(el);
|
|
116
120
|
expect(trigger.getAttribute("aria-describedby")).to.equal(tooltip.id);
|
|
117
121
|
expect(el.open).to.be.undefined;
|
|
122
|
+
const input = document.createElement("input");
|
|
123
|
+
el.insertAdjacentElement("afterbegin", input);
|
|
124
|
+
input.focus();
|
|
118
125
|
const opened = oneEvent(el, "sp-opened");
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
);
|
|
126
|
+
await sendKeys({
|
|
127
|
+
press: "Tab"
|
|
128
|
+
});
|
|
122
129
|
await opened;
|
|
123
130
|
expect(trigger.getAttribute("aria-describedby")).to.equal(tooltip.id);
|
|
124
131
|
const closed = oneEvent(el, "sp-closed");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-lifecycle.test.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport {
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport '@spectrum-web-components/tooltip/sp-tooltip.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport {\n a11ySnapshot,\n findAccessibilityNode,\n sendKeys,\n} from '@web/test-runner-commands';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\n\ndescribe('Overlay Trigger - accessible hover content management', () => {\n it('accessibly describes trigger content with hover content', async () => {\n const el = await fixture<OverlayTrigger>(html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n Button with Tooltip\n </sp-action-button>\n <sp-tooltip slot=\"hover-content\">\n Described by this content on focus/hover. 1\n </sp-tooltip>\n </overlay-trigger>\n `);\n\n await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n type DescribedNode = {\n name: string;\n description: string;\n };\n const snapshot = (await a11ySnapshot(\n {}\n )) as unknown as DescribedNode & {\n children: DescribedNode[];\n };\n expect(\n findAccessibilityNode<DescribedNode>(\n snapshot,\n (node) =>\n node.name === 'Button with Tooltip' &&\n typeof node.description === 'undefined'\n ),\n '`name`ed with no `description`'\n );\n });\n it('gardens `aria-describedby` in its target', async () => {\n const el = await fixture<OverlayTrigger>(html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\" aria-describedby=\"descriptor\">\n Button with Tooltip\n </sp-action-button>\n <sp-tooltip slot=\"hover-content\" delayed>\n Described by this content on focus/hover. 2\n </sp-tooltip>\n </overlay-trigger>\n <div id=\"descriptor\">I'm a description!</div>\n `);\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as HTMLElement;\n const tooltip = el.querySelector(\n '[slot=\"hover-content\"]'\n ) as HTMLElement;\n\n await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n await waitUntil(\n () => tooltip.id,\n 'Tooltip never published an ID for itself'\n );\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(\n `descriptor ${tooltip.id}`\n );\n\n trigger.remove();\n\n // slot change timing\n await nextFrame();\n\n expect(trigger.getAttribute('aria-describedby')).to.equal('descriptor');\n });\n it('applies `aria-describedby` attribute', async () => {\n const el = await fixture<OverlayTrigger>(html`\n <overlay-trigger placement=\"right-start\">\n <sp-action-button slot=\"trigger\">\n Button with Tooltip\n </sp-action-button>\n <sp-tooltip slot=\"hover-content\" delayed>\n Described by this content on focus/hover. 2\n </sp-tooltip>\n </overlay-trigger>\n `);\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as HTMLElement;\n const tooltip = el.querySelector(\n '[slot=\"hover-content\"]'\n ) as HTMLElement;\n\n await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n await waitUntil(\n () => tooltip.id,\n 'Tooltip never published an ID for itself'\n );\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(tooltip.id);\n\n trigger.remove();\n\n // slot change timing\n await nextFrame();\n\n expect(trigger.getAttribute('aria-describedby')).to.be.null;\n });\n it('does not duplicate `aria-describedby` attribute', async () => {\n const el = await fixture<OverlayTrigger>(html`\n <div>\n <sp-action-button slot=\"trigger\">\n Button with Tooltip\n </sp-action-button>\n <overlay-trigger placement=\"right-start\">\n <sp-tooltip slot=\"hover-content\" delayed>\n Described by this content on focus/hover. 2\n </sp-tooltip>\n </overlay-trigger>\n </div>\n `);\n\n const trigger = el.querySelector('[slot=\"trigger\"]') as HTMLElement;\n const tooltip = el.querySelector('sp-tooltip') as Tooltip;\n const overlay = el.querySelector('overlay-trigger') as OverlayTrigger;\n\n trigger.setAttribute('aria-describedby', tooltip.id);\n overlay.append(trigger);\n\n await elementUpdated(el);\n expect(trigger.getAttribute('aria-describedby')).to.equal(tooltip.id);\n expect(el.open).to.be.undefined;\n\n // For `:focus-visible` heuristic.\n const input = document.createElement('input');\n el.insertAdjacentElement('afterbegin', input);\n input.focus();\n\n const opened = oneEvent(el, 'sp-opened');\n await sendKeys({\n press: 'Tab',\n });\n await opened;\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(tooltip.id);\n\n const closed = oneEvent(el, 'sp-closed');\n trigger.dispatchEvent(\n new FocusEvent('focusout', { bubbles: true, composed: true })\n );\n await closed;\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(tooltip.id);\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,yDAAyD,MAAM;AACpE,KAAG,2DAA2D,YAAY;AACtE,UAAM,KAAK,MAAM,QAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SASxC;AAED,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAKtB,UAAM,WAAY,MAAM;AAAA,MACpB,CAAC;AAAA,IACL;AAGA;AAAA,MACI;AAAA,QACI;AAAA,QACA,CAAC,SACG,KAAK,SAAS,yBACd,OAAO,KAAK,gBAAgB;AAAA,MACpC;AAAA,MACA;AAAA,IACJ;AAAA,EACJ,CAAC;AACD,KAAG,4CAA4C,YAAY;AACvD,UAAM,KAAK,MAAM,QAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAUxC;AAED,UAAM,UAAU,GAAG,cAAc,kBAAkB;AACnD,UAAM,UAAU,GAAG;AAAA,MACf;AAAA,IACJ;AAEA,UAAM,eAAe,EAAE;A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E,WAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAGtB,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,OAAG,sBAAsB,cAAc,KAAK;AAC5C,UAAM,MAAM;AAEZ,UAAM,SAAS,SAAS,IAAI,WAAW;AACvC,UAAM,SAAS;AAAA,MACX,OAAO;AAAA,IACX,CAAC;AACD,UAAM;AAEN,WAAO,QAAQ,aAAa,kBAAkB,CAAC,EAAE,GAAG,MAAM,QAAQ,EAAE;AAEpE,UAAM,SAAS,SAAS,IAAI,WAAW;AACvC,YAAQ;AAAA,MACJ,IAAI,WAAW,YAAY,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,IAChE;AACA,UAAM;AAEN,WAAO,QAAQ,aAAa,kBAAkB,CAAC,EAAE,GAAG,MAAM,QAAQ,EAAE;AAAA,EACxE,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,6 +17,7 @@ import "@spectrum-web-components/overlay/overlay-trigger.js";
|
|
|
17
17
|
import { sendMouse } from "../../../test/plugins/browser.js";
|
|
18
18
|
import { clickAndHoverTargets, deep } from "../stories/overlay.stories.js";
|
|
19
19
|
import { ignoreResizeObserverLoopError } from "../../../test/testing-helpers.js";
|
|
20
|
+
import { sendKeys } from "@web/test-runner-commands";
|
|
20
21
|
ignoreResizeObserverLoopError(before, after);
|
|
21
22
|
describe("Overlay Trigger - Hover and Click", () => {
|
|
22
23
|
it("toggles open and closed on click", async () => {
|
|
@@ -172,6 +173,7 @@ describe("Overlay Trigger - Hover and Click", () => {
|
|
|
172
173
|
<div>${deep()}</div>
|
|
173
174
|
`);
|
|
174
175
|
const el = test.querySelector("overlay-trigger");
|
|
176
|
+
const trigger = test.querySelector("sp-button");
|
|
175
177
|
const button = el.querySelector("sp-action-button");
|
|
176
178
|
const button2 = el.querySelector(
|
|
177
179
|
"sp-action-button:nth-of-type(2)"
|
|
@@ -180,10 +182,17 @@ describe("Overlay Trigger - Hover and Click", () => {
|
|
|
180
182
|
expect(el.open).to.be.undefined;
|
|
181
183
|
expect(tooltip.open).to.be.false;
|
|
182
184
|
const opened = oneEvent(el, "sp-opened");
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
trigger.focus();
|
|
186
|
+
await sendKeys({
|
|
187
|
+
press: "Tab"
|
|
188
|
+
});
|
|
189
|
+
await sendKeys({
|
|
190
|
+
press: "Shift+Tab"
|
|
191
|
+
});
|
|
192
|
+
await sendKeys({
|
|
193
|
+
press: "Space"
|
|
194
|
+
});
|
|
185
195
|
await opened;
|
|
186
|
-
await tooltipOpen;
|
|
187
196
|
expect(el.open).to.equal("click");
|
|
188
197
|
expect(tooltip.open).to.be.true;
|
|
189
198
|
button.click();
|
|
@@ -191,7 +200,11 @@ describe("Overlay Trigger - Hover and Click", () => {
|
|
|
191
200
|
expect(el.open).to.equal("click");
|
|
192
201
|
expect(tooltip.open).to.be.true;
|
|
193
202
|
let closed = oneEvent(button, "sp-closed");
|
|
194
|
-
|
|
203
|
+
expect(document.activeElement === button, `button focused`).to.be.true;
|
|
204
|
+
await sendKeys({
|
|
205
|
+
press: "Tab"
|
|
206
|
+
});
|
|
207
|
+
expect(document.activeElement === button2, `button focused`).to.be.true;
|
|
195
208
|
await closed;
|
|
196
209
|
expect(el.open).to.equal("click");
|
|
197
210
|
expect(tooltip.open).to.be.false;
|