q2-tecton-elements 1.47.0 → 1.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/click-elsewhere_2.cjs.entry.js +43 -7
- package/dist/cjs/click-elsewhere_2.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-chart-donut.cjs.entry.js +7 -4
- package/dist/cjs/q2-chart-donut.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-data-table.cjs.entry.js +8 -5
- package/dist/cjs/q2-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +13 -4
- package/dist/cjs/q2-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +36 -27
- package/dist/cjs/q2-editable-field.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-input.cjs.entry.js +2 -2
- package/dist/cjs/q2-input.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-option-list.cjs.entry.js +2 -3
- package/dist/cjs/q2-option-list.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-relative-time.cjs.entry.js +34 -17
- package/dist/cjs/q2-relative-time.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +2 -2
- package/dist/cjs/q2-section.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +7 -2
- package/dist/cjs/q2-select.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
- package/dist/cjs/q2-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js.map +1 -1
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +7 -4
- package/dist/collection/components/q2-chart-donut/q2-chart-donut.js.map +1 -1
- package/dist/collection/components/q2-data-table/q2-data-table.css +15 -1
- package/dist/collection/components/q2-data-table/q2-data-table.js +28 -8
- package/dist/collection/components/q2-data-table/q2-data-table.js.map +1 -1
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js +22 -5
- package/dist/collection/components/q2-dropdown-item/q2-dropdown-item.js.map +1 -1
- package/dist/collection/components/q2-editable-field/q2-editable-field.js +41 -29
- package/dist/collection/components/q2-editable-field/q2-editable-field.js.map +1 -1
- package/dist/collection/components/q2-input/q2-input.js +22 -19
- package/dist/collection/components/q2-input/q2-input.js.map +1 -1
- package/dist/collection/components/q2-option-list/q2-option-list.js +2 -3
- package/dist/collection/components/q2-option-list/q2-option-list.js.map +1 -1
- package/dist/collection/components/q2-popover/q2-popover.js +43 -7
- package/dist/collection/components/q2-popover/q2-popover.js.map +1 -1
- package/dist/collection/components/q2-relative-time/q2-relative-time.js +79 -25
- package/dist/collection/components/q2-relative-time/q2-relative-time.js.map +1 -1
- package/dist/collection/components/q2-section/q2-section.js +7 -4
- package/dist/collection/components/q2-section/q2-section.js.map +1 -1
- package/dist/collection/components/q2-select/q2-select.js +7 -2
- package/dist/collection/components/q2-select/q2-select.js.map +1 -1
- package/dist/collection/components/q2-stepper/q2-stepper.js +2 -2
- package/dist/collection/components/q2-stepper/q2-stepper.js.map +1 -1
- package/dist/collection/components/q2-tab-container/q2-tab-container.css +2 -1
- package/dist/components/q2-chart-donut.js +7 -4
- package/dist/components/q2-chart-donut.js.map +1 -1
- package/dist/components/q2-data-table.js +10 -6
- package/dist/components/q2-data-table.js.map +1 -1
- package/dist/components/q2-dropdown-item2.js +16 -6
- package/dist/components/q2-dropdown-item2.js.map +1 -1
- package/dist/components/q2-editable-field.js +37 -28
- package/dist/components/q2-editable-field.js.map +1 -1
- package/dist/components/q2-input2.js +3 -3
- package/dist/components/q2-input2.js.map +1 -1
- package/dist/components/q2-option-list2.js +2 -3
- package/dist/components/q2-option-list2.js.map +1 -1
- package/dist/components/q2-popover2.js +43 -7
- package/dist/components/q2-popover2.js.map +1 -1
- package/dist/components/q2-relative-time.js +37 -18
- package/dist/components/q2-relative-time.js.map +1 -1
- package/dist/components/q2-section.js +2 -2
- package/dist/components/q2-section.js.map +1 -1
- package/dist/components/q2-select2.js +7 -2
- package/dist/components/q2-select2.js.map +1 -1
- package/dist/components/q2-stepper.js +2 -2
- package/dist/components/q2-stepper.js.map +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tab-container.js.map +1 -1
- package/dist/esm/click-elsewhere_2.entry.js +43 -7
- package/dist/esm/click-elsewhere_2.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-chart-donut.entry.js +7 -4
- package/dist/esm/q2-chart-donut.entry.js.map +1 -1
- package/dist/esm/q2-data-table.entry.js +8 -5
- package/dist/esm/q2-data-table.entry.js.map +1 -1
- package/dist/esm/q2-dropdown-item.entry.js +14 -5
- package/dist/esm/q2-dropdown-item.entry.js.map +1 -1
- package/dist/esm/q2-editable-field.entry.js +37 -28
- package/dist/esm/q2-editable-field.entry.js.map +1 -1
- package/dist/esm/q2-input.entry.js +2 -2
- package/dist/esm/q2-input.entry.js.map +1 -1
- package/dist/esm/q2-option-list.entry.js +2 -3
- package/dist/esm/q2-option-list.entry.js.map +1 -1
- package/dist/esm/q2-relative-time.entry.js +34 -17
- package/dist/esm/q2-relative-time.entry.js.map +1 -1
- package/dist/esm/q2-section.entry.js +2 -2
- package/dist/esm/q2-section.entry.js.map +1 -1
- package/dist/esm/q2-select.entry.js +7 -2
- package/dist/esm/q2-select.entry.js.map +1 -1
- package/dist/esm/q2-stepper.entry.js +2 -2
- package/dist/esm/q2-stepper.entry.js.map +1 -1
- package/dist/esm/q2-tab-container.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js.map +1 -1
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/q2-tecton-elements/p-11982614.entry.js +2 -0
- package/dist/q2-tecton-elements/p-11982614.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-e25194ce.entry.js → p-24719520.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-24719520.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-30296b0e.entry.js +2 -0
- package/dist/q2-tecton-elements/p-30296b0e.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-b849365e.entry.js → p-32b56406.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-b849365e.entry.js.map → p-32b56406.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/p-43236cac.entry.js +2 -0
- package/dist/q2-tecton-elements/p-43236cac.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-6f2de185.entry.js → p-4f7e6e79.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-4f7e6e79.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-a3d58a50.entry.js → p-56dd051a.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-56dd051a.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-6986a60e.entry.js +2 -0
- package/dist/q2-tecton-elements/{p-6eac40be.entry.js.map → p-6986a60e.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/{p-774975fa.entry.js → p-6fdda37e.entry.js} +2 -2
- package/dist/q2-tecton-elements/p-6fdda37e.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-75bb43b2.entry.js +2 -0
- package/dist/q2-tecton-elements/p-75bb43b2.entry.js.map +1 -0
- package/dist/q2-tecton-elements/p-9a71bd16.entry.js +2 -0
- package/dist/q2-tecton-elements/p-9a71bd16.entry.js.map +1 -0
- package/dist/q2-tecton-elements/{p-c9ee763d.entry.js → p-f4b28e89.entry.js} +2 -2
- package/dist/q2-tecton-elements/{p-c9ee763d.entry.js.map → p-f4b28e89.entry.js.map} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js.map +1 -1
- package/dist/test/elements/q2-chart-donut-test.e2e.js +9 -1
- package/dist/test/elements/q2-chart-donut-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-data-table-test.e2e.js +107 -11
- package/dist/test/elements/q2-data-table-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-dropdown-item-test.e2e.js +183 -104
- package/dist/test/elements/q2-dropdown-item-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-editable-field-test.e2e.js +436 -418
- package/dist/test/elements/q2-editable-field-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-popover-test.spec.js +162 -31
- package/dist/test/elements/q2-popover-test.spec.js.map +1 -1
- package/dist/test/elements/q2-relative-time-test.e2e.js +65 -40
- package/dist/test/elements/q2-relative-time-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-select-test.e2e.js +53 -22
- package/dist/test/elements/q2-select-test.e2e.js.map +1 -1
- package/dist/test/elements/q2-stepper-test.e2e.js +23 -0
- package/dist/test/elements/q2-stepper-test.e2e.js.map +1 -1
- package/dist/types/components/q2-input/q2-input.d.ts +15 -1
- package/dist/types/components/q2-popover/q2-popover.d.ts +2 -0
- package/dist/types/components/q2-relative-time/q2-relative-time.d.ts +25 -11
- package/dist/types/components/q2-section/q2-section.d.ts +10 -2
- package/dist/types/components.d.ts +53 -22
- package/dist/types/workspace/workspace/_Gitlab_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +3 -3
- package/dist/q2-tecton-elements/p-0e27ea75.entry.js +0 -2
- package/dist/q2-tecton-elements/p-0e27ea75.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-45d70da2.entry.js +0 -2
- package/dist/q2-tecton-elements/p-45d70da2.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-52e277b8.entry.js +0 -2
- package/dist/q2-tecton-elements/p-52e277b8.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-6eac40be.entry.js +0 -2
- package/dist/q2-tecton-elements/p-6f2de185.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-774975fa.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-a3d58a50.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-e25194ce.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-f450db0b.entry.js +0 -2
- package/dist/q2-tecton-elements/p-f450db0b.entry.js.map +0 -1
- package/dist/q2-tecton-elements/p-fce6bc58.entry.js +0 -2
- package/dist/q2-tecton-elements/p-fce6bc58.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"q2-popover-test.spec.js","sourceRoot":"","sources":["../../../test/elements/q2-popover-test.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAEvE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACrB,IAAI,WAAsB,CAAC;IAE3B,MAAM,wBAAwB,GAAG;QAC7B,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,GAAG;QAChB,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,EAAE;KACnB,CAAC;IAEF,MAAM,kBAAkB,GAAG;QACvB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,EAAE;QACf,kBAAkB,EAAE,wBAAwB;KAC/C,CAAC;IAEF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;gBACtE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;oBAC3B,UAAU,EAAE,CAAC,SAAS,CAAC;oBACvB,IAAI,EAAE,2BAA2B;iBACpC,CAAC,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;YAC5F,CAAC,CAAC,CAAC;YAEH,EA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,CAAC,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;YACnF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,eAAe,CAAC;gBACnF,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,GAAG;aACH,CAAC,CAAC;YACd,MAAM,WAAW,CAAC,qBAAqB,EAAE,CAAC;YAE1C,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvF,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAEnE,UAAU,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yEAAyE,EAAE,KAAK,IAAI,EAAE;YACrF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,eAAe,CAAC;gBACnF,GAAG,EAAE,GAAG;gBACR,MAAM,EAAE,GAAG;aACH,CAAC,CAAC;YACd,MAAM,WAAW,CAAC,qBAAqB,EAAE,CAAC;YAE1C,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACvF,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;YAErE,UAAU,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Q2Popover } from '../../src/components/q2-popover/q2-popover';\n\ndescribe('popover', () => {\n let specPopover: Q2Popover;\n\n const samplePlatformDimensions = {\n scrollY: 0,\n innerHeight: 800,\n innerWidth: 600,\n outletOffset: 20,\n };\n\n const sampleTectonWindow = {\n inMobileApp: false,\n noStrings: false,\n platformUrl: '',\n platformDimensions: samplePlatformDimensions,\n };\n\n describe('Props', () => {\n describe('mode', () => {\n it('does not add the legacy class on the container (default)', async () => {\n const page = await newSpecPage({\n components: [Q2Popover],\n html: `<q2-popover></q2-popover>`,\n });\n expect(page.root.shadowRoot.firstElementChild.classList.contains('legacy')).toBeFalsy();\n });\n\n it('adds the legacy class on the container when mode is \"legacy\"', async () => {\n const page = await newSpecPage({\n components: [Q2Popover],\n html: `<q2-popover mode=\"legacy\"></q2-popover>`,\n });\n expect(page.root.shadowRoot.firstElementChild.classList.contains('legacy')).toBeTruthy();\n });\n });\n });\n\n describe('Methods', () => {\n beforeEach(() => {\n specPopover = new Q2Popover();\n });\n\n describe('toggle', () => {\n it('sets open to true when open is false', async () => {\n specPopover.open = false;\n await specPopover.toggle();\n expect(specPopover.open).toBe(true);\n });\n\n it('sets open to false when open is true', async () => {\n specPopover.open = true;\n await specPopover.toggle();\n expect(specPopover.open).toBe(false);\n });\n });\n\n describe('scrollContainerTo', () => {\n it('scrolls the container to the given position', async () => {\n const containerElement = document.createElement('div');\n containerElement.scrollTo = jest.fn();\n specPopover.containerElement = containerElement;\n await specPopover.scrollContainerTo({ top: 100, left: 50 });\n expect(containerElement.scrollTo).toHaveBeenCalledWith({ top: 100, left: 50 });\n });\n });\n\n describe('openChanged', () => {\n beforeEach(() => {\n specPopover.addViewportListeners = jest.fn();\n specPopover.determinePopDirection = jest.fn();\n specPopover.removeViewportListeners = jest.fn();\n specPopover.clearCSSProperties = jest.fn();\n });\n\n it('sets open to true when open is false', async () => {\n specPopover.currentDirection = 'down';\n specPopover.show = true;\n await specPopover.openChanged(true);\n expect(specPopover.currentDirection).toBe('down');\n expect(specPopover.show).toBeTruthy();\n expect(specPopover.addViewportListeners).toHaveBeenCalled();\n expect(specPopover.determinePopDirection).toHaveBeenCalled();\n expect(specPopover.removeViewportListeners).not.toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).not.toHaveBeenCalled();\n });\n\n it('sets open to false when open is true', async () => {\n specPopover.currentDirection = 'down';\n specPopover.show = true;\n await specPopover.openChanged(false);\n expect(specPopover.currentDirection).toBeUndefined();\n expect(specPopover.show).toBeFalsy();\n expect(specPopover.addViewportListeners).not.toHaveBeenCalled();\n expect(specPopover.determinePopDirection).not.toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).toHaveBeenCalled();\n });\n });\n });\n\n describe('Getters', () => {\n beforeEach(() => {\n specPopover = new Q2Popover();\n });\n\n describe('actualDirection', () => {\n it('returns direction when \"up\"', async () => {\n specPopover.direction = 'up';\n expect(specPopover.actualDirection).toBe('up');\n });\n\n it('returns direction when \"down\"', async () => {\n specPopover.direction = 'down';\n expect(specPopover.actualDirection).toBe('down');\n });\n\n it('returns undefined when not \"up\" or \"down\"', async () => {\n (specPopover.direction as any) = 'bottom';\n expect(specPopover.actualDirection).toBeUndefined();\n });\n });\n\n describe('isModule', () => {\n it('returns false when window top matches window and platformDimensions is not defined', async () => {\n expect(window.top).toBe(window);\n expect(window.Tecton).toBeUndefined();\n expect(specPopover.isModule).toBe(false);\n });\n\n it('returns false when window top does not match window and platformDimensions is not defined', async () => {\n const windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n expect(window.top).not.toEqual(window);\n expect(window.Tecton).toBeUndefined();\n expect(specPopover.isModule).toBe(false);\n windowSpy.mockRestore();\n });\n\n it('returns false when window top matches window and platformDimensions is defined', async () => {\n window.Tecton = sampleTectonWindow;\n expect(window.top).toBe(window);\n expect(window.Tecton.platformDimensions).toBeTruthy();\n expect(specPopover.isModule).toBe(false);\n });\n\n it('returns true when window top does not match window and platformDimensions is defined', async () => {\n const windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n windowSpy.mockRestore();\n });\n });\n });\n\n describe('when in a module', () => {\n let specPopover: Q2Popover;\n let windowSpy: jest.SpyInstance;\n let controlElement: HTMLDivElement;\n let containerElement: HTMLDivElement;\n\n beforeEach(async () => {\n specPopover = new Q2Popover();\n windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n\n controlElement = document.createElement('div');\n specPopover.controlElement = controlElement;\n\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n });\n\n afterEach(() => {\n windowSpy.mockRestore();\n });\n\n describe(\"when the module is taller than the window's viewport\", () => {\n beforeEach(() => {\n specPopover.open = true;\n window.visualViewport = { height: 1200 } as any;\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('700px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 600,\n bottom: 650,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('590px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n\n describe('when the outletOffset is less than 0', () => {\n beforeEach(() => {\n window.Tecton = {\n ...sampleTectonWindow,\n platformDimensions: { ...samplePlatformDimensions, outletOffset: -50 },\n };\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('770px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 600,\n bottom: 650,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('540px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n });\n });\n\n describe(\"when the module is shorter than the window's viewport\", () => {\n beforeEach(() => {\n specPopover.open = true;\n window.visualViewport = { height: 600 } as any;\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('520px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 500,\n bottom: 550,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('490px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n });\n });\n\n describe('viewPortChanged', () => {\n let specPopover: Q2Popover;\n let windowSpy: jest.SpyInstance;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n specPopover.determinePopDirection = jest.fn();\n });\n\n afterEach(() => {\n windowSpy.mockRestore();\n });\n\n it('calls determinePopDirection when open is true', async () => {\n specPopover.open = true;\n await specPopover.viewPortChanged();\n expect(specPopover.determinePopDirection).toHaveBeenCalled();\n });\n\n it('does nothing when open is false', async () => {\n specPopover.open = false;\n await specPopover.viewPortChanged();\n expect(specPopover.determinePopDirection).not.toHaveBeenCalled();\n });\n });\n\n describe('viewPortOrientationChanged', () => {\n let specPopover: Q2Popover;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n specPopover.viewPortChanged = jest.fn();\n });\n\n it('sets orientationChanged to true and calls viewportChanged', async () => {\n await specPopover.viewPortOrientationChanged();\n expect(specPopover.orientationChanged).toBe(true);\n expect(specPopover.viewPortChanged).toHaveBeenCalled();\n });\n });\n\n describe('setFixedCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n\n const controlElement = document.createElement('div');\n controlElement.getBoundingClientRect = jest.fn().mockReturnValue({\n top: 20,\n bottom: 70,\n left: 30,\n right: 80,\n } as DOMRect);\n specPopover.controlElement = controlElement;\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n });\n\n it('sets the necessary CSS properties', async () => {\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('30px');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('720px');\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBe('1');\n });\n\n it('sets --comp-pop-bottom when direction is up', async () => {\n specPopover.currentDirection = 'up';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('580px');\n });\n\n it('sets --comp-pop-top when direction is down', async () => {\n specPopover.currentDirection = 'down';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBe('70px');\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n });\n\n it('sets --comp-pop-width when block is true', async () => {\n specPopover.block = true;\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('0px');\n });\n });\n\n describe('setAbsoluteCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.mode = 'legacy';\n specPopover.containerElement = containerElement;\n\n const controlElement = document.createElement('div');\n controlElement.getBoundingClientRect = jest.fn().mockReturnValue({\n top: 20,\n bottom: 70,\n left: 30,\n right: 80,\n } as DOMRect);\n specPopover.controlElement = controlElement;\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n });\n\n it('sets the necessary CSS properties', async () => {\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('0');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('unset');\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('');\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBe('1');\n });\n\n it('sets the necessary CSS properties when align is right', async () => {\n specPopover.align = 'right';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('unset');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('0');\n });\n\n it('sets --comp-pop-bottom when direction is up', async () => {\n specPopover.currentDirection = 'up';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('0px');\n });\n\n it('does not set --comp-pop-top when direction is down', async () => {\n specPopover.currentDirection = 'down';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBe('');\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('');\n });\n\n it('sets --comp-pop-width when block is true', async () => {\n specPopover.block = true;\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('100%');\n });\n });\n\n describe('clearCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n containerElement.style.setProperty('--comp-pop-max-height', '100px');\n containerElement.style.setProperty('--comp-pop-top', '20px');\n containerElement.style.setProperty('--comp-pop-bottom', '25px');\n containerElement.style.setProperty('--comp-pop-left', '30px');\n containerElement.style.setProperty('--comp-pop-right', '35px');\n containerElement.style.setProperty('--comp-pop-width', '200px');\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n specPopover.containerElement = containerElement;\n });\n\n it('clears the necessary CSS properties', async () => {\n await specPopover.clearCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBeFalsy();\n });\n });\n\n describe('setDirectionAndShow', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n specPopover.setFixedCSSProperties = jest.fn();\n specPopover.setAbsoluteCSSProperties = jest.fn();\n specPopover.scrollContainerTo = jest.fn();\n });\n\n it('does nothing when open is false', async () => {\n specPopover.open = false;\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBeUndefined();\n expect(specPopover.show).toBe(false);\n expect(specPopover.setFixedCSSProperties).not.toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).not.toHaveBeenCalled();\n });\n\n describe('when open is true', () => {\n beforeEach(() => {\n specPopover.open = true;\n });\n\n it('sets the direction, shows the popover, and sets fixed position properties', async () => {\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBe('up');\n expect(specPopover.show).toBe(true);\n expect(specPopover.setFixedCSSProperties).toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).not.toHaveBeenCalled();\n });\n\n it('sets the direction, shows the popover, and sets absolute position properties when mode is \"legacy\"', async () => {\n specPopover.mode = 'legacy';\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBe('up');\n expect(specPopover.show).toBe(true);\n expect(specPopover.setFixedCSSProperties).not.toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).toHaveBeenCalled();\n });\n });\n });\n\n describe('determinePopDirection', () => {\n let specPopover: Q2Popover;\n let controlElement: HTMLDivElement;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n controlElement = document.createElement('div');\n containerElement = document.createElement('div');\n specPopover.controlElement = controlElement;\n specPopover.containerElement = containerElement;\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n specPopover.setDirectionAndShow = jest.fn();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 500,\n bottom: 550,\n } as DOMRect);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('490px');\n expect(specPopover.setDirectionAndShow).toHaveBeenCalledWith('up');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 100,\n bottom: 150,\n } as DOMRect);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('440px');\n expect(specPopover.setDirectionAndShow).toHaveBeenCalledWith('down');\n\n controlSpy.mockRestore();\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"q2-popover-test.spec.js","sourceRoot":"","sources":["../../../test/elements/q2-popover-test.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAEvE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACrB,IAAI,WAAsB,CAAC;IAE3B,MAAM,wBAAwB,GAAG;QAC7B,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,GAAG;QAChB,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,EAAE;KACnB,CAAC;IAEF,MAAM,kBAAkB,GAAG;QACvB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,EAAE;QACf,kBAAkB,EAAE,wBAAwB;KAC/C,CAAC;IAEF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;gBACtE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;oBAC3B,UAAU,EAAE,CAAC,SAAS,CAAC;oBACvB,IAAI,EAAE,2BAA2B;iBACpC,CAAC,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAA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C;YAEH,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;gBACxE,iBAAiB,CAAC,WAAW,GAAG,OAAO,CAAC;gBACxC,MAAM,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;gBACpE,iBAAiB,CAAC,OAAO,GAAG,QAAQ,CAAC;gBACrC,MAAM,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;gBAC1E,iBAAiB,CAAC,aAAa,GAAG,MAAM,CAAC;gBACzC,MAAM,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;gBACvE,iBAAiB,CAAC,UAAU,GAAG,WAAW,CAAC;gBAC3C,MAAM,WAAW,CAAC,cAAc,EAAE,CAAC;gBACnC,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAChE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { Q2Popover } from '../../src/components/q2-popover/q2-popover';\n\ndescribe('popover', () => {\n let specPopover: Q2Popover;\n\n const samplePlatformDimensions = {\n scrollY: 0,\n innerHeight: 800,\n innerWidth: 600,\n outletOffset: 20,\n };\n\n const sampleTectonWindow = {\n inMobileApp: false,\n noStrings: false,\n platformUrl: '',\n platformDimensions: samplePlatformDimensions,\n };\n\n describe('Props', () => {\n describe('mode', () => {\n it('does not add the legacy class on the container (default)', async () => {\n const page = await newSpecPage({\n components: [Q2Popover],\n html: `<q2-popover></q2-popover>`,\n });\n expect(page.root.shadowRoot.firstElementChild.classList.contains('legacy')).toBeFalsy();\n });\n\n it('adds the legacy class on the container when mode is \"legacy\"', async () => {\n const page = await newSpecPage({\n components: [Q2Popover],\n html: `<q2-popover mode=\"legacy\"></q2-popover>`,\n });\n expect(page.root.shadowRoot.firstElementChild.classList.contains('legacy')).toBeTruthy();\n });\n });\n });\n\n describe('Methods', () => {\n beforeEach(() => {\n specPopover = new Q2Popover();\n });\n\n describe('toggle', () => {\n it('sets open to true when open is false', async () => {\n specPopover.open = false;\n await specPopover.toggle();\n expect(specPopover.open).toBe(true);\n });\n\n it('sets open to false when open is true', async () => {\n specPopover.open = true;\n await specPopover.toggle();\n expect(specPopover.open).toBe(false);\n });\n });\n\n describe('scrollContainerTo', () => {\n it('scrolls the container to the given position', async () => {\n const containerElement = document.createElement('div');\n containerElement.scrollTo = jest.fn();\n specPopover.containerElement = containerElement;\n await specPopover.scrollContainerTo({ top: 100, left: 50 });\n expect(containerElement.scrollTo).toHaveBeenCalledWith({ top: 100, left: 50 });\n });\n });\n });\n\n describe('Getters', () => {\n beforeEach(() => {\n specPopover = new Q2Popover();\n });\n\n describe('actualDirection', () => {\n it('returns direction when \"up\"', async () => {\n specPopover.direction = 'up';\n expect(specPopover.actualDirection).toBe('up');\n });\n\n it('returns direction when \"down\"', async () => {\n specPopover.direction = 'down';\n expect(specPopover.actualDirection).toBe('down');\n });\n\n it('returns undefined when not \"up\" or \"down\"', async () => {\n (specPopover.direction as any) = 'bottom';\n expect(specPopover.actualDirection).toBeUndefined();\n });\n });\n\n describe('isModule', () => {\n it('returns false when window top matches window and platformDimensions is not defined', async () => {\n expect(window.top).toBe(window);\n expect(window.Tecton).toBeUndefined();\n expect(specPopover.isModule).toBe(false);\n });\n\n it('returns false when window top does not match window and platformDimensions is not defined', async () => {\n const windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n expect(window.top).not.toEqual(window);\n expect(window.Tecton).toBeUndefined();\n expect(specPopover.isModule).toBe(false);\n windowSpy.mockRestore();\n });\n\n it('returns false when window top matches window and platformDimensions is defined', async () => {\n window.Tecton = sampleTectonWindow;\n expect(window.top).toBe(window);\n expect(window.Tecton.platformDimensions).toBeTruthy();\n expect(specPopover.isModule).toBe(false);\n });\n\n it('returns true when window top does not match window and platformDimensions is defined', async () => {\n const windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n windowSpy.mockRestore();\n });\n });\n });\n\n describe('when in a module', () => {\n let specPopover: Q2Popover;\n let windowSpy: jest.SpyInstance;\n let controlElement: HTMLDivElement;\n let containerElement: HTMLDivElement;\n\n beforeEach(async () => {\n specPopover = new Q2Popover();\n windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n\n controlElement = document.createElement('div');\n specPopover.controlElement = controlElement;\n\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n });\n\n afterEach(() => {\n windowSpy.mockRestore();\n });\n\n describe(\"when the module is taller than the window's viewport\", () => {\n beforeEach(() => {\n specPopover.open = true;\n window.visualViewport = { height: 1200 } as any;\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('700px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 600,\n bottom: 650,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('590px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n\n describe('when the outletOffset is less than 0', () => {\n beforeEach(() => {\n window.Tecton = {\n ...sampleTectonWindow,\n platformDimensions: { ...samplePlatformDimensions, outletOffset: -50 },\n };\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('770px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 600,\n bottom: 650,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('540px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n });\n });\n\n describe(\"when the module is shorter than the window's viewport\", () => {\n beforeEach(() => {\n specPopover.open = true;\n window.visualViewport = { height: 600 } as any;\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 20,\n bottom: 70,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('520px');\n expect(specPopover.currentDirection).toBe('down');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 500,\n bottom: 550,\n } as any);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('490px');\n expect(specPopover.currentDirection).toBe('up');\n\n controlSpy.mockRestore();\n });\n });\n });\n\n describe('viewPortChanged', () => {\n let specPopover: Q2Popover;\n let windowSpy: jest.SpyInstance;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n windowSpy = jest.spyOn(window, 'top', 'get').mockReturnValue({} as any);\n window.Tecton = sampleTectonWindow;\n expect(specPopover.isModule).toBe(true);\n specPopover.determinePopDirection = jest.fn();\n });\n\n afterEach(() => {\n windowSpy.mockRestore();\n });\n\n it('calls determinePopDirection when open is true', async () => {\n specPopover.open = true;\n await specPopover.viewPortChanged();\n expect(specPopover.determinePopDirection).toHaveBeenCalled();\n });\n\n it('does nothing when open is false', async () => {\n specPopover.open = false;\n await specPopover.viewPortChanged();\n expect(specPopover.determinePopDirection).not.toHaveBeenCalled();\n });\n });\n\n describe('viewPortOrientationChanged', () => {\n let specPopover: Q2Popover;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n specPopover.viewPortChanged = jest.fn();\n });\n\n it('sets orientationChanged to true and calls viewportChanged', async () => {\n await specPopover.viewPortOrientationChanged();\n expect(specPopover.orientationChanged).toBe(true);\n expect(specPopover.viewPortChanged).toHaveBeenCalled();\n });\n });\n\n describe('setFixedCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n specPopover.rootElementRect = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: window.visualViewport.height,\n width: window.visualViewport.width,\n } as DOMRect;\n\n const controlElement = document.createElement('div');\n controlElement.getBoundingClientRect = jest.fn().mockReturnValue({\n top: 20,\n bottom: 70,\n left: 30,\n right: 80,\n } as DOMRect);\n specPopover.controlElement = controlElement;\n });\n\n it('sets the necessary CSS properties', async () => {\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('30px');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('720px');\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBe('1');\n });\n\n it('sets --comp-pop-bottom when direction is up', async () => {\n specPopover.currentDirection = 'up';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('580px');\n });\n\n it('sets --comp-pop-top when direction is down', async () => {\n specPopover.currentDirection = 'down';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBe('70px');\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n });\n\n it('sets --comp-pop-width when block is true', async () => {\n specPopover.block = true;\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('0px');\n });\n\n describe('when rootElementRect is bonkers', () => {\n beforeEach(() => {\n specPopover.rootElementRect = {\n top: 50,\n bottom: 650,\n left: 50,\n right: 750,\n height: 600,\n width: 700,\n } as DOMRect;\n const controlElement = document.createElement('div');\n controlElement.getBoundingClientRect = jest.fn().mockReturnValue({\n top: 70,\n bottom: 120,\n left: 80,\n right: 130,\n } as DOMRect);\n specPopover.controlElement = controlElement;\n });\n\n it('sets the necessary CSS properties', async () => {\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('30px');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('620px');\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBe('1');\n });\n\n it('sets --comp-pop-bottom when direction is up', async () => {\n specPopover.currentDirection = 'up';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('580px');\n });\n\n it('sets --comp-pop-top when direction is down', async () => {\n specPopover.currentDirection = 'down';\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBe('70px');\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n });\n\n it('sets --comp-pop-width when block is true', async () => {\n specPopover.block = true;\n await specPopover.setFixedCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('0px');\n });\n });\n });\n\n describe('setAbsoluteCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.mode = 'legacy';\n specPopover.containerElement = containerElement;\n\n const controlElement = document.createElement('div');\n controlElement.getBoundingClientRect = jest.fn().mockReturnValue({\n top: 20,\n bottom: 70,\n left: 30,\n right: 80,\n } as DOMRect);\n specPopover.controlElement = controlElement;\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n });\n\n it('sets the necessary CSS properties', async () => {\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('0');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('unset');\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('');\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBe('1');\n });\n\n it('sets the necessary CSS properties when align is right', async () => {\n specPopover.align = 'right';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBe('unset');\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBe('0');\n });\n\n it('sets --comp-pop-bottom when direction is up', async () => {\n specPopover.currentDirection = 'up';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('0px');\n });\n\n it('does not set --comp-pop-top when direction is down', async () => {\n specPopover.currentDirection = 'down';\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBe('');\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBe('');\n });\n\n it('sets --comp-pop-width when block is true', async () => {\n specPopover.block = true;\n await specPopover.setAbsoluteCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBe('100%');\n });\n });\n\n describe('clearCSSProperties', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n containerElement.style.setProperty('--comp-pop-max-height', '100px');\n containerElement.style.setProperty('--comp-pop-top', '20px');\n containerElement.style.setProperty('--comp-pop-bottom', '25px');\n containerElement.style.setProperty('--comp-pop-left', '30px');\n containerElement.style.setProperty('--comp-pop-right', '35px');\n containerElement.style.setProperty('--comp-pop-width', '200px');\n containerElement.style.setProperty('--comp-pop-opacity', '1');\n specPopover.containerElement = containerElement;\n });\n\n it('clears the necessary CSS properties', async () => {\n await specPopover.clearCSSProperties();\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-top')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-bottom')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-left')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-right')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-width')).toBeFalsy();\n expect(containerElement.style.getPropertyValue('--comp-pop-opacity')).toBeFalsy();\n });\n });\n\n describe('setDirectionAndShow', () => {\n let specPopover: Q2Popover;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n containerElement = document.createElement('div');\n specPopover.containerElement = containerElement;\n specPopover.setRootElement = jest.fn();\n specPopover.setFixedCSSProperties = jest.fn();\n specPopover.setAbsoluteCSSProperties = jest.fn();\n specPopover.scrollContainerTo = jest.fn();\n });\n\n it('does nothing when open is false', async () => {\n specPopover.open = false;\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBeUndefined();\n expect(specPopover.show).toBe(false);\n expect(specPopover.setRootElement).toHaveBeenCalled();\n expect(specPopover.setFixedCSSProperties).not.toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).not.toHaveBeenCalled();\n });\n\n describe('when open is true', () => {\n beforeEach(() => {\n specPopover.open = true;\n });\n\n it('sets the direction, shows the popover, and sets fixed position properties', async () => {\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBe('up');\n expect(specPopover.show).toBe(true);\n expect(specPopover.setRootElement).toHaveBeenCalled();\n expect(specPopover.setFixedCSSProperties).toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).not.toHaveBeenCalled();\n });\n\n it('sets the direction, shows the popover, and sets absolute position properties when mode is \"legacy\"', async () => {\n specPopover.mode = 'legacy';\n await specPopover.setDirectionAndShow('up');\n expect(specPopover.currentDirection).toBe('up');\n expect(specPopover.show).toBe(true);\n expect(specPopover.setRootElement).toHaveBeenCalled();\n expect(specPopover.setFixedCSSProperties).not.toHaveBeenCalled();\n expect(specPopover.setAbsoluteCSSProperties).toHaveBeenCalled();\n });\n });\n });\n\n describe('determinePopDirection', () => {\n let specPopover: Q2Popover;\n let controlElement: HTMLDivElement;\n let containerElement: HTMLDivElement;\n\n beforeEach(() => {\n specPopover = new Q2Popover();\n controlElement = document.createElement('div');\n containerElement = document.createElement('div');\n specPopover.controlElement = controlElement;\n specPopover.containerElement = containerElement;\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n specPopover.setDirectionAndShow = jest.fn();\n });\n\n it('sets the direction to up when control element has more space above it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 500,\n bottom: 550,\n } as DOMRect);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('490px');\n expect(specPopover.setDirectionAndShow).toHaveBeenCalledWith('up');\n\n controlSpy.mockRestore();\n });\n\n it('sets the direction to down when control element has more space below it', async () => {\n const controlSpy = jest.spyOn(controlElement, 'getBoundingClientRect').mockReturnValue({\n top: 100,\n bottom: 150,\n } as DOMRect);\n await specPopover.determinePopDirection();\n\n expect(containerElement.style.getPropertyValue('--comp-pop-max-height')).toBe('440px');\n expect(specPopover.setDirectionAndShow).toHaveBeenCalledWith('down');\n\n controlSpy.mockRestore();\n });\n });\n\n describe('openChanged', () => {\n beforeEach(() => {\n specPopover = new Q2Popover();\n specPopover.setRootElement = jest.fn();\n specPopover.addViewportListeners = jest.fn();\n specPopover.determinePopDirection = jest.fn();\n specPopover.removeViewportListeners = jest.fn();\n specPopover.clearCSSProperties = jest.fn();\n });\n\n it('sets open to true when open is false', async () => {\n specPopover.currentDirection = 'down';\n specPopover.show = true;\n await specPopover.openChanged(true);\n expect(specPopover.currentDirection).toBe('down');\n expect(specPopover.show).toBeTruthy();\n expect(specPopover.setRootElement).toHaveBeenCalled();\n expect(specPopover.addViewportListeners).toHaveBeenCalled();\n expect(specPopover.determinePopDirection).toHaveBeenCalled();\n expect(specPopover.removeViewportListeners).not.toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).not.toHaveBeenCalled();\n });\n\n it('sets open to false when open is true', async () => {\n specPopover.currentDirection = 'down';\n specPopover.show = true;\n await specPopover.openChanged(false);\n expect(specPopover.currentDirection).toBeUndefined();\n expect(specPopover.show).toBeFalsy();\n expect(specPopover.setRootElement).toHaveBeenCalled();\n expect(specPopover.addViewportListeners).not.toHaveBeenCalled();\n expect(specPopover.determinePopDirection).not.toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).toHaveBeenCalled();\n expect(specPopover.clearCSSProperties).toHaveBeenCalled();\n });\n });\n\n describe('setRootElement', () => {\n let computedStyleStub: any = {};\n const popoverDOMRect = {\n top: 50,\n bottom: 125,\n left: 50,\n right: 50,\n height: 75,\n width: 700,\n } as DOMRect;\n\n beforeEach(() => {\n computedStyleStub = {\n transform: 'none',\n filter: 'none',\n perspective: 'none',\n contain: 'none',\n containerType: 'normal',\n willChange: 'auto',\n };\n window.visualViewport = { width: 800, height: 600 } as VisualViewport;\n specPopover = new Q2Popover();\n window.getComputedStyle = jest.fn().mockReturnValue(computedStyleStub);\n specPopover.hostElement.getBoundingClientRect = jest.fn().mockReturnValue(popoverDOMRect);\n });\n\n it('sets the rootElementRect by default', async () => {\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: 600,\n width: 800,\n });\n });\n\n describe('when a containing block is created by applying CSS properties', () => {\n it('returns the currentElementRect when transform is applied', async () => {\n computedStyleStub.transform = 'translate(10px, 20px)';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n\n it('returns the currentElementRect when filter is applied', async () => {\n computedStyleStub.filter = 'blur(5px)';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n\n it('returns the currentElementRect when perspective is applied', async () => {\n computedStyleStub.perspective = '100px';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n\n it('returns the currentElementRect when contain is applied', async () => {\n computedStyleStub.contain = 'layout';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n\n it('returns the currentElementRect when containerType is applied', async () => {\n computedStyleStub.containerType = 'none';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n\n it('returns the currentElementRect when willChange is applied', async () => {\n computedStyleStub.willChange = 'transform';\n await specPopover.setRootElement();\n expect(specPopover.rootElementRect).toEqual(popoverDOMRect);\n });\n });\n });\n});\n"]}
|
|
@@ -102,60 +102,74 @@ describe('q2-relative-time', () => {
|
|
|
102
102
|
});
|
|
103
103
|
describe('Props', () => {
|
|
104
104
|
describe('baseDate', () => {
|
|
105
|
-
describe('when date is NOT provided', () => {
|
|
106
|
-
it('it
|
|
105
|
+
describe('when date prop is NOT provided', () => {
|
|
106
|
+
it('it displays the default error message', async () => {
|
|
107
107
|
props = { baseDate: '2020-02-01' };
|
|
108
108
|
specPage = await createNewSpecPage(props);
|
|
109
|
-
expect(await specPage.root.
|
|
109
|
+
expect(await specPage.root.validDateProp()).toBe(false);
|
|
110
|
+
expect(await specPage.root.validBaseDateProp()).toBe(true);
|
|
111
|
+
expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');
|
|
110
112
|
});
|
|
111
113
|
});
|
|
112
|
-
describe('when
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
114
|
+
describe('when date prop is provided and valid', () => {
|
|
115
|
+
describe('when baseDate is provided and valid', () => {
|
|
116
|
+
it('renders with provided baseDate', async () => {
|
|
117
|
+
props = {
|
|
118
|
+
date: '2020-02-01',
|
|
119
|
+
baseDate: '2024-05-14',
|
|
120
|
+
};
|
|
121
|
+
specPage = await createNewSpecPage(props);
|
|
122
|
+
expect(specPage.root.baseDate).toBe('2024-05-14');
|
|
123
|
+
expect(await specPage.root.validDateProp()).toBe(true);
|
|
124
|
+
expect(await specPage.root.validBaseDateProp()).toBe(true);
|
|
125
|
+
expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');
|
|
126
|
+
});
|
|
127
|
+
it('trims the suffixes from displayedMessage', async () => {
|
|
128
|
+
props = {
|
|
129
|
+
date: '2020-02-01',
|
|
130
|
+
baseDate: '2024-05-14',
|
|
131
|
+
};
|
|
132
|
+
specPage = await createNewSpecPage(props);
|
|
133
|
+
expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');
|
|
134
|
+
});
|
|
135
|
+
it('displays only numeric messages', async () => {
|
|
136
|
+
props = {
|
|
137
|
+
date: '2020-02-01',
|
|
138
|
+
baseDate: '2020-02-02',
|
|
139
|
+
};
|
|
140
|
+
specPage = await createNewSpecPage(props);
|
|
141
|
+
expect(await specPage.root.displayedMessageValue()).not.toBe('yesterday');
|
|
142
|
+
expect(await specPage.root.displayedMessageValue()).toBe('1 day');
|
|
143
|
+
});
|
|
129
144
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
baseDate: '2020-02-02',
|
|
142
|
-
};
|
|
143
|
-
specPage = await createNewSpecPage(props);
|
|
144
|
-
expect(await specPage.root.displayedMessageValue()).toBe('1 day');
|
|
145
|
+
describe('when baseDate is provided but invalid', () => {
|
|
146
|
+
it('displays error message if the provided baseDate is invalid', async () => {
|
|
147
|
+
props = {
|
|
148
|
+
date: '2020-02-01T00:00:00Z',
|
|
149
|
+
baseDate: '02-03-2020T00:00:00Z',
|
|
150
|
+
};
|
|
151
|
+
specPage = await createNewSpecPage(props);
|
|
152
|
+
expect(await specPage.root.validBaseDateProp()).toBe(false);
|
|
153
|
+
expect(await specPage.root.displayedMessageValue()).not.toBe('2 days ago');
|
|
154
|
+
expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');
|
|
155
|
+
});
|
|
145
156
|
});
|
|
146
157
|
});
|
|
147
158
|
});
|
|
148
159
|
describe('date', () => {
|
|
149
|
-
it(
|
|
160
|
+
it('displays error message if the provided date is invalid', async () => {
|
|
150
161
|
props = { date: '02-01-2020T00:00:00Z' };
|
|
151
162
|
specPage = await createNewSpecPage(props);
|
|
152
163
|
expect(specPage.root.date).not.toBe('2020-02-01T00:00:00');
|
|
153
|
-
expect(await specPage.root.displayedMessageValue()).toBe('
|
|
164
|
+
expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');
|
|
154
165
|
});
|
|
155
|
-
it('
|
|
166
|
+
it('Displays a message when valid', async () => {
|
|
156
167
|
props = { date: '2020-02-01T00:00:00Z' };
|
|
157
168
|
specPage = await createNewSpecPage(props);
|
|
158
169
|
expect(specPage.root.date).toBe('2020-02-01T00:00:00Z');
|
|
170
|
+
expect(await specPage.root.validDateProp()).toBe(true);
|
|
171
|
+
expect(await specPage.root.displayedMessageValue()).not.toBe('tecton.element.relativeTime.invalidDate');
|
|
172
|
+
expect(await specPage.root.displayedMessageValue()).toBeTruthy();
|
|
159
173
|
});
|
|
160
174
|
});
|
|
161
175
|
describe('locale', () => {
|
|
@@ -239,10 +253,21 @@ describe('q2-relative-time', () => {
|
|
|
239
253
|
specPage = await createNewSpecPage(props);
|
|
240
254
|
expect(specPage.root.sync).toBe(false);
|
|
241
255
|
});
|
|
242
|
-
it('is automatically
|
|
256
|
+
it('is automatically set to false if date prop is invalid', async () => {
|
|
243
257
|
props = { date: '02-01-2020T00:00:00Z' };
|
|
244
258
|
specPage = await createNewSpecPage(props);
|
|
245
|
-
expect(await specPage.root.
|
|
259
|
+
expect(await specPage.root.validDateProp()).toBe(false);
|
|
260
|
+
expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');
|
|
261
|
+
expect(specPage.root.sync).toBe(false);
|
|
262
|
+
});
|
|
263
|
+
it('is automatically set to false if the provided baseDate prop is invalid', async () => {
|
|
264
|
+
props = {
|
|
265
|
+
date: '2020-02-01T00:00:00Z',
|
|
266
|
+
baseDate: '02-03-2020T00:00:00Z',
|
|
267
|
+
};
|
|
268
|
+
specPage = await createNewSpecPage(props);
|
|
269
|
+
expect(await specPage.root.validBaseDateProp()).toBe(false);
|
|
270
|
+
expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');
|
|
246
271
|
expect(specPage.root.sync).toBe(false);
|
|
247
272
|
});
|
|
248
273
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"q2-relative-time-test.e2e.js","sourceRoot":"","sources":["../../../test/elements/q2-relative-time-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AAExF,SAAS,iBAAiB,CAAC,KAQ1B;IACG,IAAI,SAAS,GAAW,EAAE,CAAC;IAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,QAAQ,GAAG,EAAE,CAAC;YACV,KAAK,MAAM;gBACP,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC;gBAC9B,MAAM;YACV,KAAK,UAAU;gBACX,SAAS,IAAI,cAAc,KAAK,EAAE,CAAC;gBACnC,MAAM;YACV,KAAK,MAAM;gBACP,SAAS,IAAI,UAAU,KAAK,GAAG,CAAC;gBAChC,MAAM;YACV,KAAK,QAAQ;gBACT,SAAS,IAAI,WAAW,KAA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S,CAAC,KAAK,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;YACrE,KAAK,GAAG;gBACJ,IAAI,EAAE,YAAY;gBAClB,QAAQ,EAAE,YAAY;aACzB,CAAC;YACF,QAAQ,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { SpecPage, newSpecPage } from '@stencil/core/testing';\nimport { evaluateA11y, getListOfStyleCompilationIssues, setup } from 'test/helpers';\nimport { Q2RelativeTime } from '../../src/components/q2-relative-time/q2-relative-time';\n\nfunction createNewSpecPage(props: {\n date?: string;\n baseDate?: string;\n sync?: boolean;\n locale?: string;\n messageFormat?: string;\n numeric?: string;\n unit?: string;\n}) {\n let htmlProps: string = '';\n Object.entries(props).forEach(([key, value]) => {\n switch (key) {\n case 'date':\n htmlProps += ` date=${value}`;\n break;\n case 'baseDate':\n htmlProps += ` base-date=${value}`;\n break;\n case 'sync':\n htmlProps += ` sync=\"${value}\"`;\n break;\n case 'locale':\n htmlProps += ` locale=${value}`;\n break;\n case 'messageFormat':\n htmlProps += ` message-format=${value}`;\n break;\n case 'numeric':\n htmlProps += ` numeric=\"${value}\"`;\n break;\n case 'unit':\n htmlProps += ` unit=${value}`;\n break;\n default:\n break;\n }\n });\n\n return newSpecPage({\n components: [Q2RelativeTime],\n html: `<q2-relative-time ${htmlProps}></q2-relative-time>`,\n });\n}\n\ndescribe('q2-relative-time', () => {\n let specPage: SpecPage;\n let props: {\n date?: string;\n baseDate?: string;\n sync?: boolean;\n locale?: string;\n messageFormat?: string;\n numeric?: string;\n unit?: string;\n };\n\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-relative-time></q2-relative-time>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-relative-time')).toHaveLength(0);\n });\n describe('[A11y] guideline compliance', () => {\n it('Does not have accessibility violations', async () => {\n const page = await setup({ html: `<q2-relative-time date='2020-02-01' />` });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n\n describe('Configuration', () => {\n it('renders with minimal configuration', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root).toEqualHtml(`\n <q2-relative-time\n date=\"2020-02-01\"\n base-date=\"2024-05-14\"\n locale=\"en-US\"\n message-format=\"short\"\n numeric=\"auto\">\n <mock:shadow-root>\n <time datetime=\"4 yr.\">\n 4 yr.\n </time>\n </mock:shadow-root>\n </q2-relative-time>\n `);\n });\n\n it('renders with full configuration', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n sync: false,\n locale: 'en-US',\n messageFormat: 'long',\n numeric: 'always',\n unit: 'year',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root).toEqualHtml(`\n <q2-relative-time\n date=\"2020-02-01\"\n base-date=\"2024-05-14\"\n sync=\"false\"\n locale=\"en-US\"\n message-format=\"long\"\n numeric=\"always\"\n unit=\"year\">\n <mock:shadow-root>\n <time datetime=\"4 years\">\n 4 years\n </time>\n </mock:shadow-root>\n </q2-relative-time>\n `);\n });\n });\n\n describe('Props', () => {\n describe('baseDate', () => {\n describe('when date is NOT provided', () => {\n it('it renders with the default baseDate', async () => {\n props = { baseDate: '2020-02-01' };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toBe('Invalid Date Provided');\n });\n });\n describe('when valid baseDate AND date are provided', () => {\n it('renders with provided baseDate', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.baseDate).toBe('2024-05-14');\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n it('trims the suffixes from displayedMessage', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n it(\"does not use the provided baseDate if it's invalid\", async () => {\n props = {\n date: '2020-02-01T00:00:00Z',\n baseDate: '02-03-2020T00:00:00Z',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).not.toBe('2 days ago');\n });\n it('displays only numeric messages', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2020-02-02',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toBe('1 day');\n });\n });\n });\n\n describe('date', () => {\n it(\"does not use the provided date if it's invalid\", async () => {\n props = { date: '02-01-2020T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.date).not.toBe('2020-02-01T00:00:00');\n expect(await specPage.root.displayedMessageValue()).toBe('Invalid Date Provided');\n });\n it('should render with valid date', async () => {\n props = { date: '2020-02-01T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.date).toBe('2020-02-01T00:00:00Z');\n });\n });\n\n describe('locale', () => {\n it('should render with given locale', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n locale: 'fr',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.locale).toBe('fr');\n expect(await specPage.root.displayedMessageValue()).toBe('il y a 4 a');\n });\n });\n\n describe('messageFormat', () => {\n describe('long', () => {\n it('should display the message in long form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'long',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('long');\n expect(await specPage.root.displayedMessageValue()).toBe('4 years');\n });\n });\n describe('short', () => {\n it('should display the message in short form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'short',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('short');\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n });\n describe('narrow', () => {\n it('should display the message in narrow form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'narrow',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('narrow');\n expect(await specPage.root.displayedMessageValue()).toBe('4y');\n });\n });\n });\n\n describe('numeric', () => {\n it('is auto by default', async () => {\n props = {\n date: '2020-02-01',\n numeric: 'auto',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.numeric).toBe('auto');\n });\n\n it('only displays numerical values when set to always', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2020-02-02',\n numeric: 'always',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.numeric).toBe('always');\n expect(await specPage.root.displayedMessageValue()).toBe('1 day');\n });\n });\n\n describe('sync', () => {\n it('is true by default', async () => {\n props = { date: '2020-02-01' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.sync).toBe(true);\n });\n it('can be set to false', async () => {\n props = { sync: false };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.sync).toBe(false);\n });\n it('is automatically disabled if date prop is invalid', async () => {\n props = { date: '02-01-2020T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toBe('Invalid Date Provided');\n expect(specPage.root.sync).toBe(false);\n });\n });\n\n describe('unit', () => {\n it('forces the message to only use the provided unit', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n unit: 'year',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.unit).toBe('year');\n expect(await specPage.root.displayedMessageValue()).toContain('yr');\n\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n unit: 'month',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.unit).toBe('month');\n expect(await specPage.root.displayedMessageValue()).toContain('mo');\n });\n });\n });\n\n describe('trimSuffix', () => {\n it('does NOT trim the suffix if baseDate is invalid or not provided', async () => {\n props = {\n date: '2020-02-02',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toContain('ago');\n });\n\n it('trims the in/ago suffix when valid baseDate is provided', async () => {\n props = {\n date: '2020-02-02',\n baseDate: '2020-02-05',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).not.toContain('ago');\n });\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"q2-relative-time-test.e2e.js","sourceRoot":"","sources":["../../../test/elements/q2-relative-time-test.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,+BAA+B,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AAExF,SAAS,iBAAiB,CAAC,KAQ1B;IACG,IAAI,SAAS,GAAW,EAAE,CAAC;IAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,QAAQ,GAAG,EAAE,CAAC;YACV,KAAK,MAAM;gBACP,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC;gBAC9B,MAAM;YACV,KAAK,UAAU;gBACX,SAAS,IAAI,cAAc,KAAK,EAAE,CAAC;gBACnC,MAAM;YACV,KAAK,MAAM;gBACP,SAAS,IAAI,UAAU,KAAK,GAAG,CAAC;gBAChC,MAAM;YACV,KAAK,QAAQ;gBACT,SAAS,IAAI,WAAW,KAAK,EAAE,CAAC;gBAChC,MAAM;YACV,KAAK,eAAe;gBAChB,SAAS,IAAI,mBAAmB,KAAK,EAAE,CAAC;gBACxC,MAAM;YACV,KAAK,SAAS;gBACV,SAAS,IAAI,aAAa,KAAK,GAAG,CAAC;gBACnC,MAAM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MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;YAC7E,KAAK,GAAG;gBACJ,IAAI,EAAE,YAAY;aACrB,CAAC;YACF,QAAQ,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;YACrE,KAAK,GAAG;gBACJ,IAAI,EAAE,YAAY;gBAClB,QAAQ,EAAE,YAAY;aACzB,CAAC;YACF,QAAQ,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["import { SpecPage, newSpecPage } from '@stencil/core/testing';\nimport { evaluateA11y, getListOfStyleCompilationIssues, setTestStrings, setup } from 'test/helpers';\nimport { Q2RelativeTime } from '../../src/components/q2-relative-time/q2-relative-time';\n\nfunction createNewSpecPage(props: {\n date?: string;\n baseDate?: string;\n sync?: boolean;\n locale?: string;\n messageFormat?: string;\n numeric?: string;\n unit?: string;\n}) {\n let htmlProps: string = '';\n Object.entries(props).forEach(([key, value]) => {\n switch (key) {\n case 'date':\n htmlProps += ` date=${value}`;\n break;\n case 'baseDate':\n htmlProps += ` base-date=${value}`;\n break;\n case 'sync':\n htmlProps += ` sync=\"${value}\"`;\n break;\n case 'locale':\n htmlProps += ` locale=${value}`;\n break;\n case 'messageFormat':\n htmlProps += ` message-format=${value}`;\n break;\n case 'numeric':\n htmlProps += ` numeric=\"${value}\"`;\n break;\n case 'unit':\n htmlProps += ` unit=${value}`;\n break;\n default:\n break;\n }\n });\n\n return newSpecPage({\n components: [Q2RelativeTime],\n html: `<q2-relative-time ${htmlProps}></q2-relative-time>`,\n });\n}\n\ndescribe('q2-relative-time', () => {\n let specPage: SpecPage;\n let props: {\n date?: string;\n baseDate?: string;\n sync?: boolean;\n locale?: string;\n messageFormat?: string;\n numeric?: string;\n unit?: string;\n };\n\n it('properly compiles CSS vars and functions', async () => {\n const page = await setup({ html: '<q2-relative-time></q2-relative-time>' });\n expect(await getListOfStyleCompilationIssues(page, 'q2-relative-time')).toHaveLength(0);\n });\n describe('[A11y] guideline compliance', () => {\n it('Does not have accessibility violations', async () => {\n const page = await setup({ html: `<q2-relative-time date='2020-02-01' />` });\n const hasViolations = await evaluateA11y(page);\n expect(hasViolations).toBe(false);\n });\n });\n\n describe('Configuration', () => {\n it('renders with minimal configuration', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root).toEqualHtml(`\n <q2-relative-time\n date=\"2020-02-01\"\n base-date=\"2024-05-14\"\n locale=\"en-US\"\n message-format=\"short\"\n numeric=\"auto\">\n <mock:shadow-root>\n <time datetime=\"4 yr.\">\n 4 yr.\n </time>\n </mock:shadow-root>\n </q2-relative-time>\n `);\n });\n\n it('renders with full configuration', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n sync: false,\n locale: 'en-US',\n messageFormat: 'long',\n numeric: 'always',\n unit: 'year',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root).toEqualHtml(`\n <q2-relative-time\n date=\"2020-02-01\"\n base-date=\"2024-05-14\"\n sync=\"false\"\n locale=\"en-US\"\n message-format=\"long\"\n numeric=\"always\"\n unit=\"year\">\n <mock:shadow-root>\n <time datetime=\"4 years\">\n 4 years\n </time>\n </mock:shadow-root>\n </q2-relative-time>\n `);\n });\n });\n\n describe('Props', () => {\n describe('baseDate', () => {\n describe('when date prop is NOT provided', () => {\n it('it displays the default error message', async () => {\n props = { baseDate: '2020-02-01' };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.validDateProp()).toBe(false);\n expect(await specPage.root.validBaseDateProp()).toBe(true);\n expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');\n });\n });\n describe('when date prop is provided and valid', () => {\n describe('when baseDate is provided and valid', () => {\n it('renders with provided baseDate', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.baseDate).toBe('2024-05-14');\n expect(await specPage.root.validDateProp()).toBe(true);\n expect(await specPage.root.validBaseDateProp()).toBe(true);\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n it('trims the suffixes from displayedMessage', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n it('displays only numeric messages', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2020-02-02',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).not.toBe('yesterday');\n expect(await specPage.root.displayedMessageValue()).toBe('1 day');\n });\n });\n describe('when baseDate is provided but invalid', () => {\n it('displays error message if the provided baseDate is invalid', async () => {\n props = {\n date: '2020-02-01T00:00:00Z',\n baseDate: '02-03-2020T00:00:00Z',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.validBaseDateProp()).toBe(false);\n expect(await specPage.root.displayedMessageValue()).not.toBe('2 days ago');\n expect(await specPage.root.displayedMessageValue()).toBe(\n 'tecton.element.relativeTime.invalidDate'\n );\n });\n });\n });\n });\n\n describe('date', () => {\n it('displays error message if the provided date is invalid', async () => {\n props = { date: '02-01-2020T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.date).not.toBe('2020-02-01T00:00:00');\n expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');\n });\n it('Displays a message when valid', async () => {\n props = { date: '2020-02-01T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.date).toBe('2020-02-01T00:00:00Z');\n expect(await specPage.root.validDateProp()).toBe(true);\n expect(await specPage.root.displayedMessageValue()).not.toBe('tecton.element.relativeTime.invalidDate');\n expect(await specPage.root.displayedMessageValue()).toBeTruthy();\n });\n });\n\n describe('locale', () => {\n it('should render with given locale', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n locale: 'fr',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.locale).toBe('fr');\n expect(await specPage.root.displayedMessageValue()).toBe('il y a 4 a');\n });\n });\n\n describe('messageFormat', () => {\n describe('long', () => {\n it('should display the message in long form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'long',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('long');\n expect(await specPage.root.displayedMessageValue()).toBe('4 years');\n });\n });\n describe('short', () => {\n it('should display the message in short form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'short',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('short');\n expect(await specPage.root.displayedMessageValue()).toBe('4 yr.');\n });\n });\n describe('narrow', () => {\n it('should display the message in narrow form', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n messageFormat: 'narrow',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.messageFormat).toBe('narrow');\n expect(await specPage.root.displayedMessageValue()).toBe('4y');\n });\n });\n });\n\n describe('numeric', () => {\n it('is auto by default', async () => {\n props = {\n date: '2020-02-01',\n numeric: 'auto',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.numeric).toBe('auto');\n });\n\n it('only displays numerical values when set to always', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2020-02-02',\n numeric: 'always',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.numeric).toBe('always');\n expect(await specPage.root.displayedMessageValue()).toBe('1 day');\n });\n });\n\n describe('sync', () => {\n it('is true by default', async () => {\n props = { date: '2020-02-01' };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.sync).toBe(true);\n });\n it('can be set to false', async () => {\n props = { sync: false };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.sync).toBe(false);\n });\n it('is automatically set to false if date prop is invalid', async () => {\n props = { date: '02-01-2020T00:00:00Z' };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.validDateProp()).toBe(false);\n expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');\n expect(specPage.root.sync).toBe(false);\n });\n it('is automatically set to false if the provided baseDate prop is invalid', async () => {\n props = {\n date: '2020-02-01T00:00:00Z',\n baseDate: '02-03-2020T00:00:00Z',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.validBaseDateProp()).toBe(false);\n expect(await specPage.root.displayedMessageValue()).toBe('tecton.element.relativeTime.invalidDate');\n expect(specPage.root.sync).toBe(false);\n });\n });\n\n describe('unit', () => {\n it('forces the message to only use the provided unit', async () => {\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n unit: 'year',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.unit).toBe('year');\n expect(await specPage.root.displayedMessageValue()).toContain('yr');\n\n props = {\n date: '2020-02-01',\n baseDate: '2024-05-14',\n unit: 'month',\n };\n specPage = await createNewSpecPage(props);\n expect(specPage.root.unit).toBe('month');\n expect(await specPage.root.displayedMessageValue()).toContain('mo');\n });\n });\n });\n\n describe('trimSuffix', () => {\n it('does NOT trim the suffix if baseDate is invalid or not provided', async () => {\n props = {\n date: '2020-02-02',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).toContain('ago');\n });\n\n it('trims the in/ago suffix when valid baseDate is provided', async () => {\n props = {\n date: '2020-02-02',\n baseDate: '2020-02-05',\n };\n specPage = await createNewSpecPage(props);\n expect(await specPage.root.displayedMessageValue()).not.toContain('ago');\n });\n });\n});\n"]}
|