diff --git a/src/__tests__/anchored-position.test.ts b/src/__tests__/anchored-position.test.ts index 3130450..2158236 100644 --- a/src/__tests__/anchored-position.test.ts +++ b/src/__tests__/anchored-position.test.ts @@ -369,16 +369,16 @@ describe('getAnchoredPosition', () => { // This test runs for values derived from a real use case https://github.com/github/accessibility-audits/issues/4515 as run on a local storybook. it('should overflow to bottom if the element is too tall to fit on the screen when zoomed', () => { - const parentRect = makeDOMRect(0, 0, 0, 0) + const parentRect = makeDOMRect(0, 0, 400, 400) const anchorRect = makeDOMRect(16, 16, 32, 32) // left aligned button - const floatingRect = makeDOMRect(0, 0, 256, 428) // 428 is the max height of the screen + const floatingRect = makeDOMRect(0, 0, 256, 428) const {float, anchor} = createVirtualDOM(parentRect, anchorRect, floatingRect) const settings: Partial = {side: 'outside-bottom', align: 'start'} const {top, left, anchorSide, anchorAlign} = getAnchoredPosition(float, anchor, settings) // Not really sure what to expect here. - expect(anchorSide).toEqual('outside-bottom') - expect(anchorAlign).toEqual('center') - expect(top).toEqual(52) - expect(left).toEqual(-256) // Expecting 32, Receiving -256 + expect(anchorSide).toEqual('outside-right') + expect(anchorAlign).toEqual('start') + expect(top).toEqual(-28) // should be 16 which is the top start of the anchor element. Negative value is wrong. + expect(left).toEqual(52) }) })