@spectrum-web-components/overlay 0.19.6-overlay.18 → 0.30.1-overlay.30

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.
Files changed (55) hide show
  1. package/overlay-trigger.dev.js +2 -1
  2. package/overlay-trigger.dev.js.map +2 -2
  3. package/overlay-trigger.js +1 -1
  4. package/overlay-trigger.js.map +3 -3
  5. package/package.json +7 -7
  6. package/sp-overlay.dev.js +2 -1
  7. package/sp-overlay.dev.js.map +2 -2
  8. package/sp-overlay.js +1 -1
  9. package/sp-overlay.js.map +3 -3
  10. package/src/Overlay.js.map +1 -1
  11. package/src/OverlayBase.d.ts +11 -1
  12. package/src/OverlayBase.dev.js +141 -91
  13. package/src/OverlayBase.dev.js.map +2 -2
  14. package/src/OverlayBase.js +6 -7
  15. package/src/OverlayBase.js.map +3 -3
  16. package/src/OverlayDialog.js.map +1 -1
  17. package/src/OverlayNoPopover.js.map +1 -1
  18. package/src/OverlayPopover.dev.js +22 -2
  19. package/src/OverlayPopover.dev.js.map +2 -2
  20. package/src/OverlayPopover.js +1 -1
  21. package/src/OverlayPopover.js.map +3 -3
  22. package/src/OverlayStack.dev.js +18 -8
  23. package/src/OverlayStack.dev.js.map +2 -2
  24. package/src/OverlayStack.js +1 -1
  25. package/src/OverlayStack.js.map +3 -3
  26. package/src/OverlayTrigger.dev.js +1 -0
  27. package/src/OverlayTrigger.dev.js.map +2 -2
  28. package/src/OverlayTrigger.js +1 -0
  29. package/src/OverlayTrigger.js.map +2 -2
  30. package/src/PlacementController.js.map +1 -1
  31. package/src/overlay-base.css.dev.js +1 -1
  32. package/src/overlay-base.css.dev.js.map +1 -1
  33. package/src/overlay-base.css.js +1 -1
  34. package/src/overlay-base.css.js.map +1 -1
  35. package/src/placement.js.map +1 -1
  36. package/src/topLayerOverTransforms.dev.js +4 -0
  37. package/src/topLayerOverTransforms.dev.js.map +2 -2
  38. package/src/topLayerOverTransforms.js +1 -1
  39. package/src/topLayerOverTransforms.js.map +2 -2
  40. package/test/index.js +113 -106
  41. package/test/index.js.map +2 -2
  42. package/test/overlay-element.test.js +345 -411
  43. package/test/overlay-element.test.js.map +2 -2
  44. package/test/overlay-lifecycle.test.js +1 -33
  45. package/test/overlay-lifecycle.test.js.map +2 -2
  46. package/test/overlay-trigger-extended.test.js +1 -1
  47. package/test/overlay-trigger-extended.test.js.map +2 -2
  48. package/test/overlay-trigger-hover-click.test.js +23 -23
  49. package/test/overlay-trigger-hover-click.test.js.map +2 -2
  50. package/test/overlay-trigger-hover.test.js +42 -36
  51. package/test/overlay-trigger-hover.test.js.map +2 -2
  52. package/test/overlay-trigger-longpress.test.js +51 -51
  53. package/test/overlay-trigger-longpress.test.js.map +2 -2
  54. package/test/overlay.test.js +8 -12
  55. package/test/overlay.test.js.map +2 -2
@@ -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 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\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('[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\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 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 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 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 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', 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 });\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 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 opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\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 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 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 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 manualClosed;\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 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\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 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 opened = oneEvent(auto, 'sp-opened');\n auto.open = true;\n await opened;\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 opened = oneEvent(manual, 'sp-opened');\n manual.open = true;\n await opened;\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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,IAAI,EAAE,GAAG,GAAG;AACxB,aAAO,OAAO,IAAI,EAAE,GAAG,GAAG;AAE1B,eAAS,SAAS,QAAQ,WAAW;AACrC,aAAO,OAAO;AACd,YAAM;AAEN,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;",
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} 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\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('[type=\"modal\"]', () => {\n opensDeclaratively('modal');\n describe('interaction with other non-ancestor overlays', function () {\n beforeEach(async function () {\n this.fixture = 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\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as OverlayBase;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as OverlayBase;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as OverlayBase;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as OverlayBase;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as OverlayBase;\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<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\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as OverlayBase;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as OverlayBase;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as OverlayBase;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as OverlayBase;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as OverlayBase;\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 });\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\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 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 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 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 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', 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 });\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<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\n this.modal = this.fixture.querySelector(\n '[type=\"modal\"]'\n ) as OverlayBase;\n this.page = this.fixture.querySelector(\n '[type=\"page\"]'\n ) as OverlayBase;\n this.hint = this.fixture.querySelector(\n '[type=\"hint\"]'\n ) as OverlayBase;\n this.auto = this.fixture.querySelector(\n '[type=\"auto\"]'\n ) as OverlayBase;\n this.manual = this.fixture.querySelector(\n '[type=\"manual\"]'\n ) as OverlayBase;\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 });\n});\n"],
5
+ "mappings": ";AAWA;AAAA,EACI;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,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A,IACL,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
6
6
  "names": []
7
7
  }
@@ -5,8 +5,7 @@ import {
5
5
  fixture,
6
6
  html,
7
7
  nextFrame,
8
- oneEvent,
9
- waitUntil
8
+ oneEvent
10
9
  } from "@open-wc/testing";
11
10
  import "@spectrum-web-components/tooltip/sp-tooltip.js";
12
11
  import "@spectrum-web-components/action-button/sp-action-button.js";
@@ -37,37 +36,6 @@ describe("Overlay Trigger - accessible hover content management", () => {
37
36
  "`name`ed with no `description`"
38
37
  );
39
38
  });
40
- xit("calls the overlay lifecycle (willOpen/openCanceled)", async () => {
41
- const el = await fixture(html`
42
- <overlay-trigger placement="right-start">
43
- <sp-action-button slot="trigger">
44
- Button with Tooltip
45
- </sp-action-button>
46
- <sp-tooltip slot="hover-content" delayed>
47
- Described by this content on focus/hover. 2
48
- </sp-tooltip>
49
- </overlay-trigger>
50
- `);
51
- await elementUpdated(el);
52
- expect(el.open).to.be.undefined;
53
- expect(el.childNodes.length, "always").to.equal(5);
54
- const trigger = el.querySelector('[slot="trigger"]');
55
- trigger.dispatchEvent(
56
- new FocusEvent("focusin", { bubbles: true, composed: true })
57
- );
58
- await elementUpdated(el);
59
- trigger.dispatchEvent(
60
- new FocusEvent("focusout", { bubbles: true, composed: true })
61
- );
62
- await elementUpdated(el);
63
- await waitUntil(() => {
64
- return el.open === null;
65
- }, "open");
66
- await elementUpdated(el);
67
- await waitUntil(() => {
68
- return el.childNodes.length === 5;
69
- }, "children");
70
- });
71
39
  it("gardens `aria-describedby` in its target", async () => {
72
40
  const el = await fixture(html`
73
41
  <overlay-trigger placement="right-start">
@@ -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 { 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,OAA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AkB,CAAC,EAAE,GAAG,MAAM,QAAQ,EAAE;AAAA,EACxE,CAAC;AACL,CAAC;",
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} 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 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,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,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;AAEvB,WAAO,QAAQ,aAAa,kBAAkB,CAAC,EAAE,GAAG;AAAA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EpE,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
  }
@@ -97,7 +97,7 @@ describe("Overlay Trigger - extended", () => {
97
97
  await nextFrame();
98
98
  expect(popover.placement).to.equal("bottom");
99
99
  });
100
- xit("occludes content behind the overlay", async () => {
100
+ it.skip("occludes content behind the overlay", async () => {
101
101
  ({ overlayTrigger, button, popover } = await initTest());
102
102
  const textfield = document.createElement("sp-textfield");
103
103
  document.body.append(textfield);
@@ -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 { 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('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 xit('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,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AU;AAAA,MACZ,OAAO;AAAA,QACH;AAAA,UACI,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;",
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 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('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.skip('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,EACI;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,8BAA8B,MAAM;AACzC,MAAI;AACJ,MAAI;AACJ,MAAI;AAEJ,YAAU,YAAY;AAClB,QAAI,eAAe,MAAM;AACrB,YAAM,SAAS,SAAS,gBAAgB,WAAW;AACnD,qBAAe,OAAO;AACtB,YAAM;AAAA,IACV;AAAA,EACJ,CAAC;AAED,KAAG,+BAA+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AG,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.skip("Overlay Trigger - Hover and Click", () => {
21
+ describe("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>
@@ -39,11 +39,11 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
39
39
  const openedEvent = oneEvent(el, "sp-opened");
40
40
  trigger.click();
41
41
  interaction = (await openedEvent).detail.interaction;
42
- expect(interaction).equals("click");
42
+ expect(interaction).equals("auto");
43
43
  const closedEvent = oneEvent(el, "sp-closed");
44
44
  trigger.click();
45
45
  interaction = (await closedEvent).detail.interaction;
46
- expect(interaction).equals("click");
46
+ expect(interaction).equals("auto");
47
47
  }
48
48
  });
49
49
  it("toggles on click after hover", async () => {
@@ -81,16 +81,16 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
81
81
  ]
82
82
  });
83
83
  interaction = (await hoveredEvent).detail.interaction;
84
- expect(interaction).equals("hover");
84
+ expect(interaction).equals("hint");
85
85
  for (let i = 0; i < 3; i++) {
86
86
  const openedEvent = oneEvent(el, "sp-opened");
87
87
  trigger.click();
88
88
  interaction = (await openedEvent).detail.interaction;
89
- expect(interaction).equals("click");
89
+ expect(interaction).equals("auto");
90
90
  const closedEvent = oneEvent(el, "sp-closed");
91
91
  trigger.click();
92
92
  interaction = (await closedEvent).detail.interaction;
93
- expect(interaction).equals("click");
93
+ expect(interaction).equals("auto");
94
94
  }
95
95
  });
96
96
  it("persists a hover overlay when clicking its trigger and closes the next highest overlay on the stack", async () => {
@@ -121,13 +121,6 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
121
121
  let opened = oneEvent(trigger1, "sp-opened");
122
122
  sendMouse({
123
123
  steps: [
124
- {
125
- type: "move",
126
- position: [
127
- rect1.left + rect1.width / 2,
128
- rect1.top + rect1.height / 2
129
- ]
130
- },
131
124
  {
132
125
  type: "click",
133
126
  position: [
@@ -138,13 +131,11 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
138
131
  ]
139
132
  });
140
133
  await opened;
141
- await elementUpdated(overlayTrigger1);
142
134
  expect(overlayTrigger1.open).to.equal("click");
143
135
  expect(overlayTrigger2.open).to.undefined;
144
136
  opened = oneEvent(trigger2, "sp-opened");
145
137
  trigger2.focus();
146
138
  await opened;
147
- await elementUpdated(overlayTrigger2);
148
139
  expect(overlayTrigger1.open).to.equal("click");
149
140
  expect(overlayTrigger2.open).to.equal("hover");
150
141
  const closed = oneEvent(trigger1, "sp-closed");
@@ -160,7 +151,7 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
160
151
  ]
161
152
  });
162
153
  await closed;
163
- expect(overlayTrigger1.open).to.be.null;
154
+ expect(overlayTrigger1.open).to.be.undefined;
164
155
  expect(overlayTrigger2.open).to.equal("hover");
165
156
  });
166
157
  it('does not close ancestor "click" overlays on `click`', async () => {
@@ -169,30 +160,39 @@ describe.skip("Overlay Trigger - Hover and Click", () => {
169
160
  `);
170
161
  const el = test.querySelector("overlay-trigger");
171
162
  const button = el.querySelector("sp-action-button");
163
+ const button2 = el.querySelector(
164
+ "sp-action-button:nth-of-type(2)"
165
+ );
172
166
  const tooltip = button.querySelector("sp-tooltip");
173
167
  expect(el.open).to.be.undefined;
174
168
  expect(tooltip.open).to.be.false;
175
- let opened = oneEvent(el, "sp-opened");
169
+ const opened = oneEvent(el, "sp-opened");
170
+ const tooltipOpen = oneEvent(button, "sp-opened");
176
171
  el.open = "click";
177
172
  await opened;
173
+ await tooltipOpen;
178
174
  expect(el.open).to.equal("click");
179
- opened = oneEvent(button, "sp-opened");
180
- button.focus();
181
- await opened;
182
175
  expect(tooltip.open).to.be.true;
183
176
  button.click();
184
177
  await aTimeout(200);
185
178
  expect(el.open).to.equal("click");
186
179
  expect(tooltip.open).to.be.true;
187
180
  let closed = oneEvent(button, "sp-closed");
188
- button.blur();
181
+ button2.focus();
189
182
  await closed;
190
183
  expect(el.open).to.equal("click");
191
184
  expect(tooltip.open).to.be.false;
192
185
  closed = oneEvent(el, "sp-closed");
193
- document.body.click();
186
+ sendMouse({
187
+ steps: [
188
+ {
189
+ type: "click",
190
+ position: [1, 1]
191
+ }
192
+ ]
193
+ });
194
194
  await closed;
195
- expect(el.open).to.be.null;
195
+ expect(el.open).to.be.undefined;
196
196
  expect(tooltip.open).to.be.false;
197
197
  });
198
198
  });