fix: align floating button safe bounds
This commit is contained in:
@@ -177,14 +177,14 @@ describe('MVP view utilities', () => {
|
||||
|
||||
it('keeps the draggable mobile add button inside the viewport', () => {
|
||||
expect(clampFabPosition(-10, -20, 390, 844)).toEqual({ x: 14, y: 14 })
|
||||
expect(clampFabPosition(500, 900, 390, 844)).toEqual({ x: 324, y: 718 })
|
||||
expect(clampFabPosition(500, 900, 390, 844)).toEqual({ x: 320, y: 704 })
|
||||
expect(clampFabPosition(120, 300, 390, 844)).toEqual({ x: 120, y: 300 })
|
||||
})
|
||||
|
||||
it('snaps the add button to the nearest horizontal edge while preserving its safe vertical position', () => {
|
||||
expect(snapFabPosition(40, 300, 390, 844)).toEqual({ x: 14, y: 300 })
|
||||
expect(snapFabPosition(280, 300, 390, 844)).toEqual({ x: 324, y: 300 })
|
||||
expect(snapFabPosition(180, 900, 390, 844)).toEqual({ x: 324, y: 718 })
|
||||
expect(snapFabPosition(40, 300, 390, 844, 56, 14, 84)).toEqual({ x: 14, y: 300 })
|
||||
expect(snapFabPosition(280, 300, 390, 844, 56, 14, 84)).toEqual({ x: 320, y: 300 })
|
||||
expect(snapFabPosition(180, 900, 390, 844, 56, 14, 84)).toEqual({ x: 320, y: 704 })
|
||||
})
|
||||
|
||||
it('validates safe habit input and emits only changed patch fields', () => {
|
||||
|
||||
Reference in New Issue
Block a user