@spectrum-web-components/overlay 0.19.2 → 0.19.4-overlay.22
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 +50 -21
- package/sp-overlay.d.ts +6 -0
- package/sp-overlay.dev.js +4 -0
- package/{active-overlay.js.map → sp-overlay.dev.js.map} +4 -4
- package/sp-overlay.js +2 -0
- package/sp-overlay.js.map +7 -0
- package/src/Overlay.d.ts +22 -0
- package/src/Overlay.dev.js +68 -0
- package/src/Overlay.dev.js.map +7 -0
- package/src/Overlay.js +2 -0
- package/src/Overlay.js.map +7 -0
- package/src/OverlayBase.d.ts +97 -0
- package/src/OverlayBase.dev.js +572 -0
- package/src/OverlayBase.dev.js.map +7 -0
- package/src/OverlayBase.js +18 -0
- package/src/OverlayBase.js.map +7 -0
- package/src/OverlayDialog.d.ts +8 -0
- package/src/OverlayDialog.dev.js +43 -0
- package/src/OverlayDialog.dev.js.map +7 -0
- package/src/OverlayDialog.js +2 -0
- package/src/OverlayDialog.js.map +7 -0
- package/src/OverlayNoPopover.d.ts +8 -0
- package/src/OverlayNoPopover.dev.js +62 -0
- package/src/OverlayNoPopover.dev.js.map +7 -0
- package/src/OverlayNoPopover.js +2 -0
- package/src/OverlayNoPopover.js.map +7 -0
- package/src/OverlayPopover.d.ts +8 -0
- package/src/OverlayPopover.dev.js +81 -0
- package/src/OverlayPopover.dev.js.map +7 -0
- package/src/OverlayPopover.js +2 -0
- package/src/OverlayPopover.js.map +7 -0
- package/src/OverlayStack.d.ts +24 -0
- package/src/OverlayStack.dev.js +115 -0
- package/src/OverlayStack.dev.js.map +7 -0
- package/src/OverlayStack.js +2 -0
- package/src/OverlayStack.js.map +7 -0
- package/src/OverlayTrigger.d.ts +18 -31
- package/src/OverlayTrigger.dev.js +138 -246
- package/src/OverlayTrigger.dev.js.map +3 -3
- package/src/OverlayTrigger.js +54 -22
- package/src/OverlayTrigger.js.map +3 -3
- package/src/PlacementController.d.ts +35 -0
- package/src/PlacementController.dev.js +172 -0
- package/src/PlacementController.dev.js.map +7 -0
- package/src/PlacementController.js +2 -0
- package/src/PlacementController.js.map +7 -0
- package/src/VirtualTrigger.dev.js +0 -2
- package/src/VirtualTrigger.dev.js.map +2 -2
- package/src/VirtualTrigger.js +1 -1
- package/src/VirtualTrigger.js.map +3 -3
- package/src/fullSizePlugin.d.ts +12 -0
- package/src/fullSizePlugin.dev.js +39 -0
- package/src/fullSizePlugin.dev.js.map +7 -0
- package/src/fullSizePlugin.js +2 -0
- package/src/fullSizePlugin.js.map +7 -0
- package/src/index.d.ts +2 -3
- package/src/index.dev.js +2 -3
- package/src/index.dev.js.map +2 -2
- package/src/index.js +1 -1
- package/src/index.js.map +2 -2
- package/src/loader.d.ts +2 -2
- package/src/loader.dev.js +2 -19
- package/src/loader.dev.js.map +2 -2
- package/src/loader.js +1 -1
- package/src/loader.js.map +3 -3
- package/src/overlay-base.css.dev.js +9 -0
- package/src/overlay-base.css.dev.js.map +7 -0
- package/src/overlay-base.css.js +6 -0
- package/src/overlay-base.css.js.map +7 -0
- package/src/overlay-trigger.css.dev.js +1 -1
- package/src/overlay-trigger.css.dev.js.map +1 -1
- package/src/overlay-trigger.css.js +1 -1
- package/src/overlay-trigger.css.js.map +1 -1
- package/src/overlay-types.d.ts +3 -3
- package/src/overlay-types.dev.js +1 -0
- package/src/overlay-types.dev.js.map +3 -3
- package/src/overlay-types.js +1 -1
- package/src/overlay-types.js.map +3 -3
- package/src/placement.d.ts +21 -0
- package/src/placement.dev.js +111 -0
- package/src/placement.dev.js.map +7 -0
- package/src/placement.js +2 -0
- package/src/placement.js.map +7 -0
- package/src/topLayerOverTransforms.d.ts +22 -0
- package/src/topLayerOverTransforms.dev.js +161 -0
- package/src/topLayerOverTransforms.dev.js.map +7 -0
- package/src/topLayerOverTransforms.js +2 -0
- package/src/topLayerOverTransforms.js.map +7 -0
- package/stories/overlay-element.stories.js +229 -0
- package/stories/overlay-element.stories.js.map +7 -0
- package/stories/overlay-story-components.js +1 -6
- package/stories/overlay-story-components.js.map +2 -2
- package/stories/overlay.stories.js +683 -644
- package/stories/overlay.stories.js.map +2 -2
- package/sync/overlay-trigger.d.ts +4 -0
- package/sync/overlay-trigger.dev.js +1 -4
- package/sync/overlay-trigger.dev.js.map +2 -2
- package/sync/overlay-trigger.js +1 -1
- package/sync/overlay-trigger.js.map +3 -3
- package/test/benchmark/basic-test.js +1 -1
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/index.js +3 -9
- package/test/index.js.map +2 -2
- package/test/overlay-element.test-vrt.js +5 -0
- package/{active-overlay.dev.js.map → test/overlay-element.test-vrt.js.map} +3 -3
- package/test/overlay-element.test.js +759 -0
- package/test/overlay-element.test.js.map +7 -0
- package/test/overlay-lifecycle.test.js +34 -74
- package/test/overlay-lifecycle.test.js.map +2 -2
- package/test/overlay-trigger-click.test.js +3 -2
- package/test/overlay-trigger-click.test.js.map +2 -2
- package/test/overlay-trigger-extended.test.js +1 -6
- package/test/overlay-trigger-extended.test.js.map +2 -2
- package/test/overlay-trigger-hover-click.test.js +1 -1
- package/test/overlay-trigger-hover-click.test.js.map +2 -2
- package/test/overlay-trigger-hover.test.js +2 -2
- package/test/overlay-trigger-hover.test.js.map +2 -2
- package/test/overlay-trigger-longpress.test.js +1 -377
- package/test/overlay-trigger-longpress.test.js.map +2 -2
- package/test/overlay-trigger-sync.test.js +1 -3
- package/test/overlay-trigger-sync.test.js.map +2 -2
- package/test/overlay-trigger.test.js +1 -3
- package/test/overlay-trigger.test.js.map +2 -2
- package/test/overlay-update.test.js +4 -4
- package/test/overlay-update.test.js.map +2 -2
- package/test/overlay.test.js +98 -146
- package/test/overlay.test.js.map +2 -2
- package/active-overlay.d.ts +0 -6
- package/active-overlay.dev.js +0 -4
- package/active-overlay.js +0 -2
- package/custom-elements.json +0 -1212
- package/src/ActiveOverlay.d.ts +0 -84
- package/src/ActiveOverlay.dev.js +0 -517
- package/src/ActiveOverlay.dev.js.map +0 -7
- package/src/ActiveOverlay.js +0 -16
- package/src/ActiveOverlay.js.map +0 -7
- package/src/active-overlay.css.dev.js +0 -13
- package/src/active-overlay.css.dev.js.map +0 -7
- package/src/active-overlay.css.js +0 -10
- package/src/active-overlay.css.js.map +0 -7
- package/src/overlay-stack.d.ts +0 -50
- package/src/overlay-stack.dev.js +0 -514
- package/src/overlay-stack.dev.js.map +0 -7
- package/src/overlay-stack.js +0 -33
- package/src/overlay-stack.js.map +0 -7
- package/src/overlay-utils.d.ts +0 -3
- package/src/overlay-utils.dev.js +0 -31
- package/src/overlay-utils.dev.js.map +0 -7
- package/src/overlay-utils.js +0 -2
- package/src/overlay-utils.js.map +0 -7
- package/src/overlay.d.ts +0 -59
- package/src/overlay.dev.js +0 -127
- package/src/overlay.dev.js.map +0 -7
- package/src/overlay.js +0 -2
- package/src/overlay.js.map +0 -7
- /package/src/{active-overlay.css.d.ts → overlay-base.css.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { OverlayBase } from '@spectrum-web-components/overlay/src/OverlayBase.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 { 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';\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<OverlayBase>(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 await aTimeout(150);\n await elementUpdated(el);\n expect(content.open).to.be.true;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n const closed = oneEvent(el, 'sp-closed');\n el.open = false;\n\n await closed;\n await aTimeout(150);\n await elementUpdated(el);\n\n expect(content.open).to.be.false;\n await nextFrame();\n opened = oneEvent(el, 'sp-opened');\n el.open = true;\n\n await opened;\n await aTimeout(150);\n await elementUpdated(el);\n expect(content.open).to.be.true;\n });\n }\n\n describe('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(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 const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n let closed = oneEvent(page, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(modal, 'sp-closed');\n modal.open = false;\n await closed;\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(modal, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n modal.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n });\n });\n describe('[type=\"page\"]', () => {\n opensDeclaratively('page');\n xit('closes all other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(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 const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n let closed = oneEvent(modal, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(modal);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(hint, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(auto, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(auto);\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n page.open = false;\n await closed;\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n closed = oneEvent(manual, 'sp-closed');\n page.open = true;\n await opened;\n await closed;\n await elementUpdated(page);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\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<OverlayBase>(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 OverlayBase;\n const hint2 = test.querySelector('.hint-2') as OverlayBase;\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 await aTimeout(150);\n await elementUpdated(hint1);\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 aTimeout(150);\n await closed;\n await elementUpdated(hint1);\n await elementUpdated(hint2);\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 await elementUpdated(hint1);\n await elementUpdated(hint2);\n\n expect(hint1.open).to.be.true;\n expect(hint2.open).to.be.false;\n });\n xit('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 placement=\"bottom\"\n offset=\"-5\"\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 OverlayBase;\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 // 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 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 await elementUpdated(el);\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 await elementUpdated(el);\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\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 await elementUpdated(el);\n });\n it('stays open when pointer enters overlay from trigger element', 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 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 await aTimeout(150);\n await elementUpdated(el);\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 await aTimeout(150);\n await elementUpdated(el);\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 aTimeout(150);\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 await elementUpdated(el);\n expect(el.open).to.be.false;\n });\n });\n describe('[type=\"auto\"]', () => {\n opensDeclaratively('auto');\n });\n describe('[type=\"manual\"]', () => {\n opensDeclaratively('manual');\n\n it('does not close other overlay types when opening', async () => {\n const test = await styledFixture<OverlayBase>(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 const modal = test.querySelector('[type=\"modal\"]') as OverlayBase;\n const page = test.querySelector('[type=\"page\"]') as OverlayBase;\n const hint = test.querySelector('[type=\"hint\"]') as OverlayBase;\n const auto = test.querySelector('[type=\"auto\"]') as OverlayBase;\n const manual = test.querySelector('[type=\"manual\"]') as OverlayBase;\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n let opened = oneEvent(modal, 'sp-opened');\n modal.open = true;\n await opened;\n await aTimeout(150);\n await elementUpdated(modal);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n // Required to cover the fact that `sp-opened` in 'modal'/'page'\n // overlays fires pseudo-syncronously, which means the transition\n // to \"open\" won't have started in a way that would allow `transitionend`\n // events to announce \"closed\" without the extra await between open => close\n // state transitions.\n //\n // Lock down the `sp-opened/closed` contract across overlay types...\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await aTimeout(150);\n await elementUpdated(manual);\n expect(modal.open).to.be.true;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n let closed = oneEvent(modal, 'sp-closed');\n let manualClosed = oneEvent(manual, 'sp-closed');\n modal.open = false;\n manual.open = false;\n await closed;\n await manualClosed;\n await aTimeout(150);\n await elementUpdated(modal);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(page, 'sp-opened');\n page.open = true;\n await opened;\n await aTimeout(150);\n await elementUpdated(page);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await aTimeout(150);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.true;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(page, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n page.open = false;\n manual.open = false;\n await closed;\n await aTimeout(150);\n await manualClosed;\n await elementUpdated(page);\n await elementUpdated(manual);\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(hint, 'sp-opened');\n hint.open = true;\n await opened;\n await aTimeout(150);\n await elementUpdated(hint);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.true;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.true;\n\n await nextFrame();\n\n closed = oneEvent(hint, 'sp-closed');\n manualClosed = oneEvent(manual, 'sp-closed');\n hint.open = false;\n manual.open = false;\n await closed;\n await elementUpdated(hint);\n await elementUpdated(manual);\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.false;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\n await elementUpdated(auto);\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.false;\n\n await nextFrame();\n\n opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\n await elementUpdated(manual);\n\n expect(modal.open).to.be.false;\n expect(page.open).to.be.false;\n expect(hint.open).to.be.false;\n expect(auto.open).to.be.true;\n expect(manual.open).to.be.true;\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;AAGP,OAAO;AACP,OAAO;AACP,OAAO;AAEP,SAAS,iBAAiB;AAG1B,MAAM,gBAAgB,CAAC,SAAS,QAAQ,QAAQ,QAAQ,QAAQ;AAGhE,eAAe,cACX,OACU;AACV,QAAM,OAAO,MAAM,QAAe;AAAA;AAAA,cAExB;AAAA;AAAA,KAET;AACD,SAAO,KAAK,SAAS,CAA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ACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,YAAM,UAAU;AAEhB,eAAS,SAAS,MAAM,WAAW;AACnC,WAAK,OAAO;AACZ,YAAM;AACN,YAAM,eAAe,IAAI;AAEzB,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,YAAM,UAAU;AAEhB,eAAS,SAAS,QAAQ,WAAW;AACrC,aAAO,OAAO;AACd,YAAM;AACN,YAAM,eAAe,MAAM;AAE3B,aAAO,MAAM,IAAI,EAAE,GAAG,GAAG;AACzB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,KAAK,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IAC9B,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
expect,
|
|
5
5
|
fixture,
|
|
6
6
|
html,
|
|
7
|
+
nextFrame,
|
|
7
8
|
oneEvent,
|
|
8
9
|
waitUntil
|
|
9
10
|
} from "@open-wc/testing";
|
|
@@ -11,8 +12,8 @@ import "@spectrum-web-components/tooltip/sp-tooltip.js";
|
|
|
11
12
|
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
12
13
|
import "@spectrum-web-components/overlay/overlay-trigger.js";
|
|
13
14
|
import { a11ySnapshot, findAccessibilityNode } from "@web/test-runner-commands";
|
|
14
|
-
describe("Overlay Trigger -
|
|
15
|
-
it("
|
|
15
|
+
describe("Overlay Trigger - accessible hover content management", () => {
|
|
16
|
+
it("accessibly describes trigger content with hover content", async () => {
|
|
16
17
|
const el = await fixture(html`
|
|
17
18
|
<overlay-trigger placement="right-start">
|
|
18
19
|
<sp-action-button slot="trigger">
|
|
@@ -25,9 +26,9 @@ describe("Overlay Trigger - Lifecycle Methods", () => {
|
|
|
25
26
|
`);
|
|
26
27
|
await elementUpdated(el);
|
|
27
28
|
expect(el.open).to.be.undefined;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const snapshot = await a11ySnapshot(
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
31
32
|
expect(
|
|
32
33
|
findAccessibilityNode(
|
|
33
34
|
snapshot,
|
|
@@ -35,31 +36,8 @@ describe("Overlay Trigger - Lifecycle Methods", () => {
|
|
|
35
36
|
),
|
|
36
37
|
"`name`ed with no `description`"
|
|
37
38
|
);
|
|
38
|
-
const opened = oneEvent(el, "sp-opened");
|
|
39
|
-
trigger.dispatchEvent(
|
|
40
|
-
new FocusEvent("focusin", { bubbles: true, composed: true })
|
|
41
|
-
);
|
|
42
|
-
await opened;
|
|
43
|
-
expect(el.open).to.equal("hover");
|
|
44
|
-
snapshot = await a11ySnapshot({});
|
|
45
|
-
expect(el.childNodes.length).to.equal(6);
|
|
46
|
-
expect(
|
|
47
|
-
findAccessibilityNode(
|
|
48
|
-
snapshot,
|
|
49
|
-
(node) => node.name === "Button with Tooltip" && node.description === "Described by this content on focus/hover."
|
|
50
|
-
),
|
|
51
|
-
"`name`ed with `description`"
|
|
52
|
-
);
|
|
53
|
-
const closed = oneEvent(el, "sp-closed");
|
|
54
|
-
trigger.dispatchEvent(
|
|
55
|
-
new FocusEvent("focusout", { bubbles: true, composed: true })
|
|
56
|
-
);
|
|
57
|
-
await closed;
|
|
58
|
-
await elementUpdated(el);
|
|
59
|
-
await waitUntil(() => el.open === null);
|
|
60
|
-
expect(el.childNodes.length).to.equal(5);
|
|
61
39
|
});
|
|
62
|
-
|
|
40
|
+
xit("calls the overlay lifecycle (willOpen/openCanceled)", async () => {
|
|
63
41
|
const el = await fixture(html`
|
|
64
42
|
<overlay-trigger placement="right-start">
|
|
65
43
|
<sp-action-button slot="trigger">
|
|
@@ -103,27 +81,18 @@ describe("Overlay Trigger - Lifecycle Methods", () => {
|
|
|
103
81
|
<div id="descriptor">I'm a description!</div>
|
|
104
82
|
`);
|
|
105
83
|
const trigger = el.querySelector('[slot="trigger"]');
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
expect(trigger.getAttribute("aria-describedby")).to.equal("descriptor");
|
|
109
|
-
expect(el.open).to.be.undefined;
|
|
110
|
-
expect(el.childNodes.length, "always").to.equal(5);
|
|
111
|
-
const opened = oneEvent(el, "sp-opened");
|
|
112
|
-
trigger.dispatchEvent(
|
|
113
|
-
new FocusEvent("focusin", { bubbles: true, composed: true })
|
|
84
|
+
const tooptip = el.querySelector(
|
|
85
|
+
'[slot="hover-content"]'
|
|
114
86
|
);
|
|
115
|
-
await
|
|
87
|
+
await elementUpdated(el);
|
|
116
88
|
expect(trigger.getAttribute("aria-describedby")).to.equal(
|
|
117
|
-
`descriptor ${
|
|
89
|
+
`descriptor ${tooptip.id}`
|
|
118
90
|
);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
new FocusEvent("focusout", { bubbles: true, composed: true })
|
|
122
|
-
);
|
|
123
|
-
await closed;
|
|
91
|
+
trigger.remove();
|
|
92
|
+
await nextFrame();
|
|
124
93
|
expect(trigger.getAttribute("aria-describedby")).to.equal("descriptor");
|
|
125
94
|
});
|
|
126
|
-
it("
|
|
95
|
+
it("applies `aria-describedby` attribute", async () => {
|
|
127
96
|
const el = await fixture(html`
|
|
128
97
|
<overlay-trigger placement="right-start">
|
|
129
98
|
<sp-action-button slot="trigger">
|
|
@@ -135,57 +104,48 @@ describe("Overlay Trigger - Lifecycle Methods", () => {
|
|
|
135
104
|
</overlay-trigger>
|
|
136
105
|
`);
|
|
137
106
|
const trigger = el.querySelector('[slot="trigger"]');
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
expect(trigger.hasAttribute("aria-describedby")).to.be.false;
|
|
141
|
-
expect(el.open).to.be.undefined;
|
|
142
|
-
expect(el.childNodes.length, "always").to.equal(5);
|
|
143
|
-
const opened = oneEvent(el, "sp-opened");
|
|
144
|
-
trigger.dispatchEvent(
|
|
145
|
-
new FocusEvent("focusin", { bubbles: true, composed: true })
|
|
107
|
+
const tooptip = el.querySelector(
|
|
108
|
+
'[slot="hover-content"]'
|
|
146
109
|
);
|
|
147
|
-
await
|
|
148
|
-
expect(trigger.getAttribute("aria-describedby")).to.equal(
|
|
149
|
-
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
trigger.dispatchEvent(
|
|
153
|
-
new FocusEvent("focusout", { bubbles: true, composed: true })
|
|
154
|
-
);
|
|
155
|
-
await closed;
|
|
156
|
-
expect(trigger.hasAttribute("aria-describedby")).to.be.false;
|
|
110
|
+
await elementUpdated(el);
|
|
111
|
+
expect(trigger.getAttribute("aria-describedby")).to.equal(tooptip.id);
|
|
112
|
+
trigger.remove();
|
|
113
|
+
await nextFrame();
|
|
114
|
+
expect(trigger.getAttribute("aria-describedby")).to.be.null;
|
|
157
115
|
});
|
|
158
116
|
it("does not duplicate `aria-describedby` attribute", async () => {
|
|
159
117
|
const el = await fixture(html`
|
|
160
|
-
<
|
|
118
|
+
<div>
|
|
161
119
|
<sp-action-button slot="trigger">
|
|
162
120
|
Button with Tooltip
|
|
163
121
|
</sp-action-button>
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
122
|
+
<overlay-trigger placement="right-start">
|
|
123
|
+
<sp-tooltip slot="hover-content" delayed>
|
|
124
|
+
Described by this content on focus/hover. 2
|
|
125
|
+
</sp-tooltip>
|
|
126
|
+
</overlay-trigger>
|
|
127
|
+
</div>
|
|
168
128
|
`);
|
|
169
129
|
const trigger = el.querySelector('[slot="trigger"]');
|
|
170
130
|
const tooltip = el.querySelector("sp-tooltip");
|
|
171
|
-
const
|
|
172
|
-
trigger.setAttribute("aria-describedby",
|
|
131
|
+
const overlay = el.querySelector("overlay-trigger");
|
|
132
|
+
trigger.setAttribute("aria-describedby", tooltip.id);
|
|
133
|
+
overlay.append(trigger);
|
|
173
134
|
await elementUpdated(el);
|
|
174
|
-
expect(trigger.getAttribute("aria-describedby")).to.equal(
|
|
135
|
+
expect(trigger.getAttribute("aria-describedby")).to.equal(tooltip.id);
|
|
175
136
|
expect(el.open).to.be.undefined;
|
|
176
|
-
expect(el.childNodes.length, "always").to.equal(5);
|
|
177
137
|
const opened = oneEvent(el, "sp-opened");
|
|
178
138
|
trigger.dispatchEvent(
|
|
179
139
|
new FocusEvent("focusin", { bubbles: true, composed: true })
|
|
180
140
|
);
|
|
181
141
|
await opened;
|
|
182
|
-
expect(trigger.getAttribute("aria-describedby")).to.equal(
|
|
142
|
+
expect(trigger.getAttribute("aria-describedby")).to.equal(tooltip.id);
|
|
183
143
|
const closed = oneEvent(el, "sp-closed");
|
|
184
144
|
trigger.dispatchEvent(
|
|
185
145
|
new FocusEvent("focusout", { bubbles: true, composed: true })
|
|
186
146
|
);
|
|
187
147
|
await closed;
|
|
188
|
-
expect(trigger.getAttribute("aria-describedby")).to.equal(
|
|
148
|
+
expect(trigger.getAttribute("aria-describedby")).to.equal(tooltip.id);
|
|
189
149
|
});
|
|
190
150
|
});
|
|
191
151
|
//# sourceMappingURL=overlay-lifecycle.test.js.map
|
|
@@ -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 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 { a11ySnapshot, findAccessibilityNode } from '@web/test-runner-commands';\nimport { Tooltip } from '@spectrum-web-components/tooltip';\n\ndescribe('Overlay Trigger -
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AACP,SAAS,cAAc,6BAA6B;AAGpD,SAAS,
|
|
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 { a11ySnapshot, findAccessibilityNode } 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 xit('calls the overlay lifecycle (willOpen/openCanceled)', 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 await elementUpdated(el);\n\n expect(el.open).to.be.undefined;\n expect(el.childNodes.length, 'always').to.equal(5);\n const trigger = el.querySelector('[slot=\"trigger\"]') as HTMLElement;\n trigger.dispatchEvent(\n new FocusEvent('focusin', { bubbles: true, composed: true })\n );\n await elementUpdated(el);\n trigger.dispatchEvent(\n new FocusEvent('focusout', { bubbles: true, composed: true })\n );\n await elementUpdated(el);\n\n await waitUntil(() => {\n return el.open === null;\n }, 'open');\n await elementUpdated(el);\n await waitUntil(() => {\n return el.childNodes.length === 5;\n }, 'children');\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 tooptip = el.querySelector(\n '[slot=\"hover-content\"]'\n ) as HTMLElement;\n\n await elementUpdated(el);\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(\n `descriptor ${tooptip.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 tooptip = el.querySelector(\n '[slot=\"hover-content\"]'\n ) as HTMLElement;\n\n await elementUpdated(el);\n\n expect(trigger.getAttribute('aria-describedby')).to.equal(tooptip.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 const opened = oneEvent(el, 'sp-opened');\n trigger.dispatchEvent(\n new FocusEvent('focusin', { bubbles: true, composed: true })\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,SAAS,cAAc,6BAA6B;AAGpD,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,MAAI,uDAAuD,YAAY;AACnE,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;AACtB,WAAO,GAAG,WAAW,QAAQ,QAAQ,EAAE,GAAG,MAAM,CAAC;AACjD,UAAM,UAAU,GAAG,cAAc,kBAAkB;AACnD,YAAQ;AAAA,MACJ,IAAI,WAAW,WAAW,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,IAC/D;AACA,UAAM,eAAe,EAAE;AACvB,YAAQ;AAAA,MACJ,IAAI,WAAW,YA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AAAA;AAAA;AAAA,SAWxC;AAED,UAAM,UAAU,GAAG,cAAc,kBAAkB;AACnD,UAAM,UAAU,GAAG,cAAc,YAAY;AAC7C,UAAM,UAAU,GAAG,cAAc,iBAAiB;AAElD,YAAQ,aAAa,oBAAoB,QAAQ,EAAE;AACnD,YAAQ,OAAO,OAAO;AAEtB,UAAM,eAAe,EAAE;AACvB,WAAO,QAAQ,aAAa,kBAAkB,CAAC,EAAE,GAAG,MAAM,QAAQ,EAAE;AACpE,WAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,UAAM,SAAS,SAAS,IAAI,WAAW;AACvC,YAAQ;AAAA,MACJ,IAAI,WAAW,WAAW,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,IAC/D;AACA,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
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
expect,
|
|
5
5
|
fixture,
|
|
6
6
|
html,
|
|
7
|
+
nextFrame,
|
|
7
8
|
oneEvent,
|
|
8
9
|
waitUntil
|
|
9
10
|
} from "@open-wc/testing";
|
|
@@ -32,12 +33,12 @@ describe("Overlay Trigger - Click", () => {
|
|
|
32
33
|
</overlay-trigger>
|
|
33
34
|
`)()
|
|
34
35
|
);
|
|
35
|
-
await elementUpdated(el);
|
|
36
36
|
await waitUntil(
|
|
37
37
|
() => openedSpy.calledOnce,
|
|
38
38
|
"click content projected to overlay",
|
|
39
39
|
{ timeout: 2e3 }
|
|
40
40
|
);
|
|
41
|
+
await nextFrame();
|
|
41
42
|
el.removeAttribute("open");
|
|
42
43
|
await elementUpdated(el);
|
|
43
44
|
await waitUntil(() => closedSpy.calledOnce, "click content returned", {
|
|
@@ -78,7 +79,7 @@ describe("Overlay Trigger - Click", () => {
|
|
|
78
79
|
document.scrollingElement.scrollTop = 100;
|
|
79
80
|
}
|
|
80
81
|
await closed;
|
|
81
|
-
expect(el.open).to.be.
|
|
82
|
+
expect(el.open).to.be.undefined;
|
|
82
83
|
});
|
|
83
84
|
}
|
|
84
85
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-trigger-click.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 oneEvent,\n waitUntil,\n} from '@open-wc/testing';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport {\n OverlayTrigger,\n TriggerInteractions,\n} from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { spy } from 'sinon';\nimport { ActionButton } from '@spectrum-web-components/action-button';\n\ndescribe('Overlay Trigger - Click', () => {\n it('displays `click` declaratively', async () => {\n const openedSpy = spy();\n const closedSpy = spy();\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger\n placement=\"right-start\"\n open=\"click\"\n @sp-opened=${() => openedSpy()}\n @sp-closed=${() => closedSpy()}\n >\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"click-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n
|
|
5
|
-
"mappings": ";AAWA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AAKP,OAAO;AACP,SAAS,WAAW;AAGpB,SAAS,2BAA2B,MAAM;AACtC,KAAG,kCAAkC,YAAY;AAC7C,UAAM,YAAY,IAAI;AACtB,UAAM,YAAY,IAAI;AACtB,UAAM,KAAK,MAAM;AAAA,OACZ,MAAM;AAAA;AAAA;AAAA;AAAA,iCAIc,MAAM,UAAU;AAAA,iCAChB,MAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlC;AAAA,IACP;
|
|
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/popover/sp-popover.js';\nimport '@spectrum-web-components/action-button/sp-action-button.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-magnify.js';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport {\n OverlayTrigger,\n TriggerInteractions,\n} from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { spy } from 'sinon';\nimport { ActionButton } from '@spectrum-web-components/action-button';\n\ndescribe('Overlay Trigger - Click', () => {\n it('displays `click` declaratively', async () => {\n const openedSpy = spy();\n const closedSpy = spy();\n const el = await fixture<OverlayTrigger>(\n (() => html`\n <overlay-trigger\n placement=\"right-start\"\n open=\"click\"\n @sp-opened=${() => openedSpy()}\n @sp-closed=${() => closedSpy()}\n >\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"click-content\" tip></sp-popover>\n </overlay-trigger>\n `)()\n );\n\n await waitUntil(\n () => openedSpy.calledOnce,\n 'click content projected to overlay',\n { timeout: 2000 }\n );\n\n await nextFrame();\n\n el.removeAttribute('open');\n await elementUpdated(el);\n\n await waitUntil(() => closedSpy.calledOnce, 'click content returned', {\n timeout: 2000,\n });\n });\n describe('closes on scroll', () => {\n afterEach(() => {\n if (document.scrollingElement) {\n document.scrollingElement.scrollTop = 0;\n }\n });\n (['click', 'replace', 'inline'] as TriggerInteractions[]).map(\n (interaction) => {\n it(`closes \"${interaction}\" overlay on scroll`, async () => {\n const el = await fixture<OverlayTrigger>(html`\n <overlay-trigger\n placement=\"right-start\"\n type=${interaction}\n >\n <sp-action-button\n slot=\"trigger\"\n style=\"margin: 50vh 0 100vh;\"\n >\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"click-content\" tip></sp-popover>\n </overlay-trigger>\n `);\n expect(el.open).to.be.undefined;\n\n await elementUpdated(el);\n const opened = oneEvent(el, 'sp-opened');\n el.open = 'click';\n await opened;\n\n expect(el.open).to.equal('click');\n\n const closed = oneEvent(el, 'sp-closed');\n if (document.scrollingElement) {\n document.scrollingElement.scrollTop = 100;\n }\n await closed;\n\n expect(el.open).to.be.undefined;\n });\n }\n );\n });\n it('opens a second time', async () => {\n const openedSpy = spy();\n const closedSpy = spy();\n const el = await fixture<OverlayTrigger>(html`\n <overlay-trigger\n placement=\"right-start\"\n type=\"modal\"\n open=\"click\"\n @sp-opened=${() => openedSpy()}\n @sp-closed=${() => closedSpy()}\n >\n <sp-action-button slot=\"trigger\">\n <sp-icon-magnify slot=\"icon\"></sp-icon-magnify>\n </sp-action-button>\n <sp-popover slot=\"click-content\" tip></sp-popover>\n </overlay-trigger>\n `);\n await elementUpdated(el);\n const trigger = el.querySelector('[slot=trigger]') as ActionButton;\n\n await waitUntil(\n () => openedSpy.calledOnce,\n 'click content projected to overlay',\n { timeout: 2000 }\n );\n expect(el.open).to.equal('click');\n\n el.removeAttribute('open');\n await elementUpdated(el);\n\n await waitUntil(() => closedSpy.calledOnce, 'click content returned', {\n timeout: 2000,\n });\n\n expect(el.open).to.be.null;\n\n trigger.click();\n await waitUntil(\n () => openedSpy.callCount === 2,\n 'click content projected to overlay, again',\n { timeout: 2000 }\n );\n expect(el.open).to.equal('click');\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;AACP,OAAO;AACP,OAAO;AAKP,OAAO;AACP,SAAS,WAAW;AAGpB,SAAS,2BAA2B,MAAM;AACtC,KAAG,kCAAkC,YAAY;AAC7C,UAAM,YAAY,IAAI;AACtB,UAAM,YAAY,IAAI;AACtB,UAAM,KAAK,MAAM;AAAA,OACZ,MAAM;AAAA;AAAA;AAAA;AAAA,iCAIc,MAAM,UAAU;AAAA,iCAChB,MAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAOlC;AAAA,IACP;AAEA,UAAM;AAAA,MACF,MAAM,UAAU;AAAA,MAChB;AAAA,MACA,EAAE,SAAS,IAAK;AAAA,IACpB;AAEA,UAAM,UAAU;AAEhB,OAAG,gBAAgB,MAAM;AACzB,UAAM,eAAe,EAAE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;AAAA,IACpB;AACA,WAAO,GAAG,IAAI,EAAE,GAAG,MAAM,OAAO;AAEhC,OAAG,gBAAgB,MAAM;AACzB,UAAM,eAAe,EAAE;AAEvB,UAAM,UAAU,MAAM,UAAU,YAAY,0BAA0B;AAAA,MAClE,SAAS;AAAA,IACb,CAAC;AAED,WAAO,GAAG,IAAI,EAAE,GAAG,GAAG;AAEtB,YAAQ,MAAM;AACd,UAAM;AAAA,MACF,MAAM,UAAU,cAAc;AAAA,MAC9B;AAAA,MACA,EAAE,SAAS,IAAK;AAAA,IACpB;AACA,WAAO,GAAG,IAAI,EAAE,GAAG,MAAM,OAAO;AAAA,EACpC,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import {
|
|
3
|
-
elementUpdated,
|
|
4
3
|
expect,
|
|
5
4
|
fixture,
|
|
6
5
|
html,
|
|
@@ -55,7 +54,7 @@ const initTest = async (styles = html``) => {
|
|
|
55
54
|
popover: test.querySelector("sp-popover")
|
|
56
55
|
};
|
|
57
56
|
};
|
|
58
|
-
describe("Overlay Trigger - extended", () => {
|
|
57
|
+
describe.skip("Overlay Trigger - extended", () => {
|
|
59
58
|
let overlayTrigger;
|
|
60
59
|
let button;
|
|
61
60
|
let popover;
|
|
@@ -196,10 +195,6 @@ describe("Overlay Trigger - extended", () => {
|
|
|
196
195
|
const open = oneEvent(overlayTrigger, "sp-opened");
|
|
197
196
|
button.click();
|
|
198
197
|
await open;
|
|
199
|
-
const activeOverlay = document.querySelector(
|
|
200
|
-
"active-overlay"
|
|
201
|
-
);
|
|
202
|
-
await elementUpdated(activeOverlay);
|
|
203
198
|
expect(overlayTrigger.open).to.equal("click");
|
|
204
199
|
expect(popover.placement).to.equal("bottom");
|
|
205
200
|
expect(scrollingArea.scrollTop).to.equal(distance);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["overlay-trigger-extended.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';\n\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport {
|
|
5
|
-
"mappings": ";AAWA;AAAA,
|
|
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';\n\nimport '@spectrum-web-components/overlay/overlay-trigger.js';\nimport { OverlayTrigger } from '@spectrum-web-components/overlay';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { Button } from '@spectrum-web-components/button';\nimport '@spectrum-web-components/popover/sp-popover.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport '@spectrum-web-components/textfield/sp-textfield.js';\nimport { sendMouse } from '../../../test/plugins/browser.js';\n\nconst initTest = async (\n styles = html``\n): Promise<{\n overlayTrigger: OverlayTrigger;\n button: Button;\n popover: Popover;\n}> => {\n const test = await fixture<HTMLDivElement>(\n html`\n <div class=\"container\">\n <style>\n .container {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n </style>\n ${styles}\n <overlay-trigger type=\"modal\" id=\"trigger\" placement=\"top\">\n <sp-button\n id=\"outer-button\"\n variant=\"primary\"\n slot=\"trigger\"\n >\n Show Popover\n </sp-button>\n <sp-popover\n id=\"outer-popover\"\n dialog\n slot=\"click-content\"\n direction=\"bottom\"\n tip\n open\n tabindex=\"0\"\n placement=\"top\"\n >\n This is the overlay content.\n </sp-popover>\n </overlay-trigger>\n </div>\n `\n );\n return {\n overlayTrigger: test.querySelector('overlay-trigger') as OverlayTrigger,\n button: test.querySelector('sp-button') as Button,\n popover: test.querySelector('sp-popover') as Popover,\n };\n};\n\ndescribe.skip('Overlay Trigger - extended', () => {\n let overlayTrigger!: OverlayTrigger;\n let button!: Button;\n let popover!: Popover;\n\n afterEach(async () => {\n if (overlayTrigger.open) {\n const closed = oneEvent(overlayTrigger, 'sp-closed');\n overlayTrigger.open = undefined;\n await closed;\n }\n });\n\n it('manages `placement` on open', async () => {\n ({ overlayTrigger, button, popover } = await initTest());\n\n expect(popover.placement).to.equal('top');\n\n const open = oneEvent(overlayTrigger, 'sp-opened');\n button.click();\n await open;\n\n expect(popover.placement).to.equal('bottom');\n\n const close = oneEvent(overlayTrigger, 'sp-closed');\n overlayTrigger.open = undefined;\n await close;\n\n expect(popover.placement).to.equal('top');\n });\n\n it('manages `placement` on scroll', async () => {\n ({ overlayTrigger, button, popover } = await initTest(html`\n <style>\n sp-button {\n margin: 100vh 0;\n transform: translateY(-100%);\n }\n </style>\n `));\n\n expect(popover.placement).to.equal('top');\n\n const open = oneEvent(overlayTrigger, 'sp-opened');\n button.click();\n await open;\n\n expect(popover.placement).to.equal('top');\n\n const { scrollHeight } = document.documentElement;\n document.documentElement.scrollTop = scrollHeight / 2;\n\n // one frame for scroll to trigger\n await nextFrame();\n // one frame for the UI to update\n await nextFrame();\n // _then_ we test...\n expect(popover.placement).to.equal('bottom');\n });\n\n it('occludes content behind the overlay', async () => {\n ({ overlayTrigger, button, popover } = await initTest());\n const textfield = document.createElement('sp-textfield');\n document.body.append(textfield);\n\n const boundingRect = textfield.getBoundingClientRect();\n expect(document.activeElement).to.not.equal(textfield);\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n boundingRect.left + boundingRect.width / 2,\n boundingRect.top + boundingRect.height / 2,\n ],\n },\n ],\n });\n expect(document.activeElement).to.equal(textfield);\n\n expect(popover.placement).to.equal('top');\n\n const open = oneEvent(overlayTrigger, 'sp-opened');\n button.click();\n await open;\n\n expect(overlayTrigger.open).to.equal('click');\n expect(popover.placement).to.equal('bottom');\n\n const close = oneEvent(overlayTrigger, 'sp-closed');\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n boundingRect.left + boundingRect.width / 2,\n boundingRect.top + boundingRect.height / 2,\n ],\n },\n ],\n });\n await close;\n expect(overlayTrigger.open).to.be.null;\n expect(document.activeElement).to.not.equal(textfield);\n await sendMouse({\n steps: [\n {\n type: 'click',\n position: [\n boundingRect.left + boundingRect.width / 2,\n boundingRect.top + boundingRect.height / 2,\n ],\n },\n ],\n });\n expect(document.activeElement).to.equal(textfield);\n textfield.remove();\n });\n\n xit('occludes wheel interactions behind the overlay', async () => {\n /**\n * This test \"passes\" when tested manually in browser, but\n * not when leveraged in the automated test process.\n *\n * xit for now...\n **/\n ({ overlayTrigger, button, popover } = await initTest());\n const scrollingArea = document.createElement('div');\n Object.assign(scrollingArea.style, {\n width: '100px',\n height: '100px',\n overflow: 'auto',\n });\n const content = Array(100).fill(\n 'This is content within my box that will scroll.'\n );\n scrollingArea.textContent = content.join(' ');\n document.body.append(scrollingArea);\n await nextFrame();\n\n const boundingRect = scrollingArea.getBoundingClientRect();\n expect(scrollingArea.scrollTop).to.equal(0);\n const distance = 1;\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [\n boundingRect.left + boundingRect.width / 2,\n boundingRect.top + boundingRect.height / 2,\n ],\n },\n ],\n });\n await sendMouse({\n steps: [\n {\n type: 'wheel',\n position: [0, distance],\n },\n ],\n });\n // wait for scroll to complete\n await waitUntil(\n () => scrollingArea.scrollTop === distance,\n `scroll went to ${distance}`\n );\n expect(scrollingArea.scrollTop).to.equal(distance);\n\n expect(popover.placement).to.equal('top');\n\n const open = oneEvent(overlayTrigger, 'sp-opened');\n button.click();\n await open;\n // const activeOverlay = document.querySelector(\n // 'active-overlay'\n // ) as HTMLDivElement;\n // await elementUpdated(activeOverlay);\n\n expect(overlayTrigger.open).to.equal('click');\n expect(popover.placement).to.equal('bottom');\n expect(scrollingArea.scrollTop).to.equal(distance);\n await sendMouse({\n steps: [\n {\n type: 'wheel',\n position: [0, -distance],\n },\n ],\n });\n // Awaiting here points out that this always fails in Firefox\n // and also was failing in WebKit without our knowing.\n await nextFrame();\n await nextFrame();\n await nextFrame();\n expect(\n scrollingArea.scrollTop,\n `scrollTop should be ${distance}.`\n ).to.equal(distance);\n scrollingArea.remove();\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA;AAAA,EAEI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,OAAO;AAEP,OAAO;AAEP,OAAO;AAEP,OAAO;AACP,SAAS,iBAAiB;AAE1B,MAAM,WAAW,OACb,SAAS,WAKP;AACF,QAAM,OAAO,MAAM;AAAA,IACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBASU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBd;AACA,SAAO;AAAA,IACH,gBAAgB,KAAK,cAAc,iBAAiB;AAAA,IACpD,QAAQ,KAAK,cAAc,WAAW;AAAA,IACtC,SAAS,KAAK,cAAc,YAAY;AAAA,EAC5C;AACJ;AAEA,SAAS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I,MAAM;AAAA,UACN,UAAU,CAAC,GAAG,CAAC,QAAQ;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ,CAAC;AAGD,UAAM,UAAU;AAChB,UAAM,UAAU;AAChB,UAAM,UAAU;AAChB;AAAA,MACI,cAAc;AAAA,MACd,uBAAuB;AAAA,IAC3B,EAAE,GAAG,MAAM,QAAQ;AACnB,kBAAc,OAAO;AAAA,EACzB,CAAC;AACL,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ 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
20
|
ignoreResizeObserverLoopError(before, after);
|
|
21
|
-
describe("Overlay Trigger - Hover and Click", () => {
|
|
21
|
+
describe.skip("Overlay Trigger - Hover and Click", () => {
|
|
22
22
|
it("toggles open and closed on click", async () => {
|
|
23
23
|
const el = await fixture(html`
|
|
24
24
|
<overlay-trigger>
|