Skip to content

Commit

Permalink
wip fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lf94 committed Sep 23, 2024
1 parent ddb8ef2 commit 6003179
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
21 changes: 17 additions & 4 deletions e2e/playwright/testing-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,19 +606,32 @@ const extrude001 = extrude(5, sketch001)
`
)
})
await page.setViewportSize({ width: 1200, height: 500 })
const viewport = { width: 1200, height: 500 }
await page.setViewportSize(viewport)
await u.waitForAuthSkipAppStart()

const getMiddleOfModelingArea = async (viewport) => {

Check failure on line 613 in e2e/playwright/testing-settings.spec.ts

View workflow job for this annotation

GitHub Actions / check-types

Parameter 'viewport' implicitly has an 'any' type.
const panes = page.getByTestId('pane-section')
const bb = await panes.boundingBox()
const goRightPx = bb.width > 0 ? (viewport.width - bb.width) / 2 : 0

Check failure on line 616 in e2e/playwright/testing-settings.spec.ts

View workflow job for this annotation

GitHub Actions / check-types

'bb' is possibly 'null'.

Check failure on line 616 in e2e/playwright/testing-settings.spec.ts

View workflow job for this annotation

GitHub Actions / check-types

'bb' is possibly 'null'.
return {
x: viewport.width / 2 + goRightPx,
y: viewport.height / 2,
}
}

// Selectors and constants
const editSketchButton = page.getByRole('button', { name: 'Edit Sketch' })
const lineToolButton = page.getByTestId('line')
const segmentOverlays = page.getByTestId('segment-overlay')
const sketchOriginLocation = { x: 600, y: 250 }
const sketchOriginLocation = await getMiddleOfModelingArea(viewport)
const darkThemeSegmentColor: [number, number, number] = [215, 215, 215]
const lightThemeSegmentColor: [number, number, number] = [90, 90, 90]

await test.step(`Get into sketch mode`, async () => {
await u.waitForAuthSkipAppStart()
await page.mouse.click(700, 200)
const aLineToClickOn = await u.getBoundingBox('[data-overlay-index="0"]')
await page.mouse.move(aLineToClickOn.x, aLineToClickOn.y)

await expect(editSketchButton).toBeVisible()
await editSketchButton.click()

Expand Down
1 change: 1 addition & 0 deletions src/components/ModelingSidebar/ModelingSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export const ModelingSidebar = forwardRef<
</ul>
<ul
id="pane-section"
data-testid="pane-section"
ref={ref}
className={
'ml-[-1px] col-start-2 col-span-1 flex flex-col gap-2 ' +
Expand Down

0 comments on commit 6003179

Please sign in to comment.