Skip to content

Commit f18cbf6

Browse files
lint and test
1 parent fc8dcb2 commit f18cbf6

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bldrs",
3-
"version": "1.0.1892",
3+
"version": "1.0.1893",
44
"main": "src/index.jsx",
55
"license": "AGPL-3.0",
66
"homepage": "https://github.com/bldrs-ai/Share",

src/Components/Apps/Apps.spec.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {expect, test} from '@playwright/test'
2+
import {assertDefined} from 'src/utils/assert'
23
import {
34
homepageSetup,
45
returningUserVisitsHomepageWaitForModel,
@@ -62,27 +63,25 @@ describe('AppsSideDrawer', () => {
6263
const appsDrawer = page.getByTestId('AppsDrawer')
6364

6465
const handle = notesDrawer.getByTestId('resize-handle-x')
65-
const handleBox = await handle.boundingBox()
66-
expect(handleBox).toBeTruthy()
66+
const handleBox = assertDefined(await handle.boundingBox())
6767

6868
// Drag left to widen Notes (this used to push Apps out of view).
6969
await page.mouse.move(
70-
handleBox!.x + handleBox!.width / 2,
71-
handleBox!.y + handleBox!.height / 2,
70+
handleBox.x + (handleBox.width / 2),
71+
handleBox.y + (handleBox.height / 2),
7272
)
7373
await page.mouse.down()
74-
await page.mouse.move(handleBox!.x - 250, handleBox!.y + handleBox!.height / 2)
74+
const dragDistance = 250
75+
await page.mouse.move(handleBox.x - dragDistance, handleBox.y + (handleBox.height / 2))
7576
await page.mouse.up()
7677

7778
// Apps should remain visible and inside the viewport.
7879
await expect(page.getByTestId(`PanelTitle-${TITLE_APPS}`)).toBeVisible()
7980

80-
const appsBox = await appsDrawer.boundingBox()
81-
expect(appsBox).toBeTruthy()
82-
81+
const appsBox = assertDefined(await appsDrawer.boundingBox())
8382
const vw = await page.evaluate(() => window.innerWidth)
84-
expect(appsBox!.x).toBeGreaterThanOrEqual(0)
85-
expect(appsBox!.x + appsBox!.width).toBeLessThanOrEqual(vw + 1)
83+
expect(appsBox.x).toBeGreaterThanOrEqual(0)
84+
expect(appsBox.x + (appsBox.width)).toBeLessThanOrEqual(vw + 1)
8685
})
8786
})
8887
})

src/Containers/RootLandscape.test.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ import ShareMock from '../ShareMock'
44
import RootLandscape from './RootLandscape'
55

66

7-
jest.mock('./ControlsGroup', () => () => <div data-testid='MockControlsGroup'/>)
8-
jest.mock('./OperationsGroup', () => () => <div data-testid='MockOperationsGroup'/>)
7+
jest.mock('./ControlsGroup', () => ({
8+
__esModule: true,
9+
default: () => <div data-testid='MockControlsGroup'/>,
10+
}))
911

12+
jest.mock('./OperationsGroup', () => ({
13+
__esModule: true,
14+
default: () => <div data-testid='MockOperationsGroup'/>,
15+
}))
1016

1117
describe('RootLandscape', () => {
1218
it('center pane is flex and root does not overflow', () => {

0 commit comments

Comments
 (0)