yarn lint

This commit is contained in:
lee-at-zoo-corp
2025-03-27 11:08:43 -04:00
parent 9e19d131eb
commit fb192ee213
6 changed files with 31 additions and 42 deletions

View File

@ -90,7 +90,7 @@ test.describe('Feature Tree pane', () => {
await scene.settled(cmdBar) await scene.settled(cmdBar)
await toolbar.openFeatureTreePane() await toolbar.openFeatureTreePane()
await page.getByText('Feature tree') await expect(page.getByText('Feature tree')).toBeVisible()
}) })
async function testViewSource({ async function testViewSource({

View File

@ -74,7 +74,7 @@ test.describe('Point-and-click tests', () => {
await test.step('do extrude flow and check extrude code is added to editor', async () => { await test.step('do extrude flow and check extrude code is added to editor', async () => {
await toolbar.extrudeButton.click() await toolbar.extrudeButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
@ -1031,7 +1031,7 @@ openSketch = startSketchOn(XY)
}) })
await test.step(`Go through the command bar flow`, async () => { await test.step(`Go through the command bar flow`, async () => {
await toolbar.offsetPlaneButton.click() await toolbar.offsetPlaneButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'plane', currentArgKey: 'plane',
@ -1093,7 +1093,7 @@ openSketch = startSketchOn(XY)
await test.step(`Go through the command bar flow`, async () => { await test.step(`Go through the command bar flow`, async () => {
await toolbar.helixButton.click() await toolbar.helixButton.click()
await page.getByText('AxisOrEdge') await expect(page.getByText('AxisOrEdge')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'mode', currentArgKey: 'mode',
@ -1109,7 +1109,7 @@ openSketch = startSketchOn(XY)
commandName: 'Helix', commandName: 'Helix',
}) })
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await page.getByText('Axis') await expect(page.getByText('Axis')).toBeVisible()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -1242,7 +1242,7 @@ openSketch = startSketchOn(XY)
await test.step(`Go through the command bar flow`, async () => { await test.step(`Go through the command bar flow`, async () => {
await toolbar.closePane('code') await toolbar.closePane('code')
await toolbar.helixButton.click() await toolbar.helixButton.click()
await page.getByText('AxisOrEdge') await expect(page.getByText('AxisOrEdge')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'mode', currentArgKey: 'mode',
@ -1258,7 +1258,7 @@ openSketch = startSketchOn(XY)
commandName: 'Helix', commandName: 'Helix',
}) })
await cmdBar.selectOption({ name: 'Edge' }).click() await cmdBar.selectOption({ name: 'Edge' }).click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await clickOnEdge() await clickOnEdge()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.argumentInput.focus() await cmdBar.argumentInput.focus()
@ -1537,7 +1537,7 @@ extrude001 = extrude(profile001, length = 100)
if (!shouldPreselect) { if (!shouldPreselect) {
await test.step(`Go through the command bar flow without preselected sketches`, async () => { await test.step(`Go through the command bar flow without preselected sketches`, async () => {
await toolbar.loftButton.click() await toolbar.loftButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -1556,7 +1556,7 @@ extrude001 = extrude(profile001, length = 100)
await test.step(`Go through the command bar flow with preselected sketches`, async () => { await test.step(`Go through the command bar flow with preselected sketches`, async () => {
await toolbar.loftButton.click() await toolbar.loftButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
}) })
} }
@ -1717,7 +1717,7 @@ sketch002 = startSketchOn(XZ)
await test.step(`Go through the command bar flow`, async () => { await test.step(`Go through the command bar flow`, async () => {
await toolbar.sweepButton.click() await toolbar.sweepButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
commandName: 'Sweep', commandName: 'Sweep',
currentArgKey: 'target', currentArgKey: 'target',
@ -1854,7 +1854,7 @@ sketch002 = startSketchOn(XZ)
await test.step(`Go through the command bar flow and fail validation with a toast`, async () => { await test.step(`Go through the command bar flow and fail validation with a toast`, async () => {
await toolbar.sweepButton.click() await toolbar.sweepButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
commandName: 'Sweep', commandName: 'Sweep',
currentArgKey: 'target', currentArgKey: 'target',
@ -1971,7 +1971,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Apply fillet to the preselected edge`, async () => { await test.step(`Apply fillet to the preselected edge`, async () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await toolbar.filletButton.click() await toolbar.filletButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
commandName: 'Fillet', commandName: 'Fillet',
highlightedHeaderArg: 'selection', highlightedHeaderArg: 'selection',
@ -2072,7 +2072,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Open fillet UI without selecting edges`, async () => { await test.step(`Open fillet UI without selecting edges`, async () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await toolbar.filletButton.click() await toolbar.filletButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -2439,7 +2439,7 @@ extrude001 = extrude(profile001, length = 5)
await test.step(`Apply fillet`, async () => { await test.step(`Apply fillet`, async () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await toolbar.filletButton.click() await toolbar.filletButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
commandName: 'Fillet', commandName: 'Fillet',
highlightedHeaderArg: 'selection', highlightedHeaderArg: 'selection',
@ -2557,7 +2557,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Apply chamfer to the preselected edge`, async () => { await test.step(`Apply chamfer to the preselected edge`, async () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await toolbar.chamferButton.click() await toolbar.chamferButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
commandName: 'Chamfer', commandName: 'Chamfer',
highlightedHeaderArg: 'selection', highlightedHeaderArg: 'selection',
@ -2665,7 +2665,7 @@ extrude001 = extrude(sketch001, length = -12)
await test.step(`Open chamfer UI without selecting edges`, async () => { await test.step(`Open chamfer UI without selecting edges`, async () => {
await page.waitForTimeout(100) await page.waitForTimeout(100)
await toolbar.chamferButton.click() await toolbar.chamferButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -2975,7 +2975,7 @@ extrude001 = extrude(sketch001, length = 30)
if (!shouldPreselect) { if (!shouldPreselect) {
await test.step(`Go through the command bar flow without preselected faces`, async () => { await test.step(`Go through the command bar flow without preselected faces`, async () => {
await toolbar.shellButton.click() await toolbar.shellButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -3010,7 +3010,7 @@ extrude001 = extrude(sketch001, length = 30)
await test.step(`Go through the command bar flow with a preselected face (cap)`, async () => { await test.step(`Go through the command bar flow with a preselected face (cap)`, async () => {
await toolbar.shellButton.click() await toolbar.shellButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await page.waitForTimeout(500) await page.waitForTimeout(500)
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -3117,7 +3117,7 @@ extrude001 = extrude(sketch001, length = 40)
await test.step(`Go through the command bar flow, selecting a wall and keeping default thickness`, async () => { await test.step(`Go through the command bar flow, selecting a wall and keeping default thickness`, async () => {
await toolbar.shellButton.click() await toolbar.shellButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -3129,7 +3129,9 @@ extrude001 = extrude(sketch001, length = 40)
highlightedHeaderArg: 'selection', highlightedHeaderArg: 'selection',
commandName: 'Shell', commandName: 'Shell',
}) })
await page.getByText('Please select one or more face') await expect(
page.getByText('Please select one or more face')
).toBeVisible()
await clickOnCap() await clickOnCap()
await page.keyboard.down('Shift') await page.keyboard.down('Shift')
await clickOnWall() await clickOnWall()
@ -3256,7 +3258,7 @@ extrude002 = extrude(sketch002, length = 50)
await test.step(`Go through the command bar flow, selecting a cap and keeping default thickness`, async () => { await test.step(`Go through the command bar flow, selecting a cap and keeping default thickness`, async () => {
await toolbar.shellButton.click() await toolbar.shellButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -3268,7 +3270,9 @@ extrude002 = extrude(sketch002, length = 50)
highlightedHeaderArg: 'selection', highlightedHeaderArg: 'selection',
commandName: 'Shell', commandName: 'Shell',
}) })
await page.getByText('Please select one or more face') await expect(
page.getByText('Please select one or more face')
).toBeVisible()
await clickOnCap() await clickOnCap()
await page.waitForTimeout(500) await page.waitForTimeout(500)
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -3425,7 +3429,7 @@ sweep001 = sweep(sketch001, path = sketch002)
await test.step(`Go through the Shell flow and fail validation with a toast`, async () => { await test.step(`Go through the Shell flow and fail validation with a toast`, async () => {
await toolbar.shellButton.click() await toolbar.shellButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.expectState({ await cmdBar.expectState({
stage: 'arguments', stage: 'arguments',
currentArgKey: 'selection', currentArgKey: 'selection',
@ -3496,7 +3500,7 @@ segAng(rectangleSegmentA002),
// revolve // revolve
await page.getByText(codeToSelection).click() await page.getByText(codeToSelection).click()
await toolbar.revolveButton.click() await toolbar.revolveButton.click()
await page.getByText('Please select one') await expect(page.getByText('Please select one')).toBeVisible()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()
@ -3669,7 +3673,7 @@ sketch003 = startSketchOn(extrude001, 'START')
await page.waitForTimeout(1000) await page.waitForTimeout(1000)
await editor.scrollToText(codeToSelection) await editor.scrollToText(codeToSelection)
await page.getByText(codeToSelection).click() await page.getByText(codeToSelection).click()
await page.getByText('AxisOrEdge', { exact: true }) await expect(page.getByText('AxisOrEdge', { exact: true })).toBeVisible()
await page.getByText('Edge', { exact: true }).click() await page.getByText('Edge', { exact: true }).click()
const lineCodeToSelection = `length = 2.6` const lineCodeToSelection = `length = 2.6`
await editor.scrollToText(lineCodeToSelection) await editor.scrollToText(lineCodeToSelection)

View File

@ -775,7 +775,6 @@ test.describe(`Project management commands`, () => {
`${dir}/${projectName}/main.kcl` `${dir}/${projectName}/main.kcl`
) )
}) })
const u = await getUtils(page)
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')
@ -836,7 +835,6 @@ test.describe(`Project management commands`, () => {
`${dir}/${projectName}/main.kcl` `${dir}/${projectName}/main.kcl`
) )
}) })
const u = await getUtils(page)
// Constants and locators // Constants and locators
const projectHomeLink = page.getByTestId('project-link') const projectHomeLink = page.getByTestId('project-link')

View File

@ -15,7 +15,7 @@ import { err, reportRejection, trap } from 'lib/trap'
import { getArtifactOfTypes } from 'lang/std/artifactGraph' import { getArtifactOfTypes } from 'lang/std/artifactGraph'
import { ViewControlContextMenu } from './ViewControlMenu' import { ViewControlContextMenu } from './ViewControlMenu'
import { useSettings, engineStreamActor } from 'machines/appMachine' import { useSettings, engineStreamActor } from 'machines/appMachine'
import { commandBarActor, useCommandBarState } from 'machines/commandBarMachine' import { useCommandBarState } from 'machines/commandBarMachine'
import { import {
EngineStreamState, EngineStreamState,
EngineStreamTransition, EngineStreamTransition,

View File

@ -140,14 +140,7 @@ export const ModelingMachineProvider = ({
}) => { }) => {
const { const {
app: { theme, allowOrbitInSketchMode }, app: { theme, allowOrbitInSketchMode },
modeling: { modeling: { defaultUnit, cameraProjection, highlightEdges, cameraOrbit },
defaultUnit,
cameraProjection,
highlightEdges,
showScaleGrid,
cameraOrbit,
enableSSAO,
},
} = useSettings() } = useSettings()
const navigate = useNavigate() const navigate = useNavigate()
const { context, send: fileMachineSend } = useFileContext() const { context, send: fileMachineSend } = useFileContext()
@ -156,9 +149,6 @@ export const ModelingMachineProvider = ({
const streamRef = useRef<HTMLDivElement>(null) const streamRef = useRef<HTMLDivElement>(null)
const persistedContext = useMemo(() => getPersistedContext(), []) const persistedContext = useMemo(() => getPersistedContext(), [])
let [searchParams] = useSearchParams()
const pool = searchParams.get('pool')
const isCommandBarClosed = useSelector( const isCommandBarClosed = useSelector(
commandBarActor, commandBarActor,
commandBarIsClosedSelector commandBarIsClosedSelector

View File

@ -1,5 +1,4 @@
import { jsAppSettings } from 'lang/wasm' import { jsAppSettings } from 'lang/wasm'
import { uuidv4 } from 'lib/utils'
import { MutableRefObject } from 'react' import { MutableRefObject } from 'react'
import { setup, assign, fromPromise } from 'xstate' import { setup, assign, fromPromise } from 'xstate'
import { import {
@ -8,8 +7,6 @@ import {
sceneInfra, sceneInfra,
engineCommandManager, engineCommandManager,
} from 'lib/singletons' } from 'lib/singletons'
import { trap } from 'lib/trap'
import { Vector3, Vector4 } from 'three'
export enum EngineStreamState { export enum EngineStreamState {
Off = 'off', Off = 'off',