fix playwright (#3352)

* fix playwright

* fix another test
This commit is contained in:
Kurt Hutten
2024-08-12 15:16:13 +10:00
committed by GitHub
parent 4b9f71c994
commit 5a25b60485
5 changed files with 82 additions and 22 deletions

41
src/test-utils.test.ts Normal file
View File

@ -0,0 +1,41 @@
import { normaliseKclNumbers } from '../e2e/playwright/test-utils'
test('normaliseKclNumbers', () => {
expect(
normaliseKclNumbers(`const sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %)
|> line([20, 0], %)
|> line([0, -20], %)
|> line([-20, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const extrude001 = extrude(-15, sketch001)`)
).toBe(`const sketch001 = startSketchOn('XY')
|> startProfileAt([-12.34, 12.34], %)
|> line([12.34, 0], %)
|> line([0, -12.34], %)
|> line([-12.34, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const extrude001 = extrude(-12.34, sketch001)`)
expect(
normaliseKclNumbers(
`const sketch001 = startSketchOn('XY')
|> startProfileAt([-10, 10], %)
|> line([20, 0], %)
|> line([0, -20], %)
|> line([-20, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const extrude001 = extrude(-15, sketch001)`,
false
)
).toBe(`const sketch001 = startSketchOn('XY')
|> startProfileAt([-12.34, 12.34], %)
|> line([12.34, 12.34], %)
|> line([12.34, -12.34], %)
|> line([-12.34, 12.34], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const extrude001 = extrude(-12.34, sketch001)`)
})