Merge branch 'main' into nadro/adhoc/kcl-samples-subdirs

This commit is contained in:
Kevin Nadro
2025-05-20 09:54:13 -05:00
committed by GitHub
5 changed files with 47 additions and 3 deletions

View File

@ -143,11 +143,11 @@ jobs:
- name: Install browsers
run: npm run playwright install --with-deps
- name: Capture snapshots
- name: Test snapshots
uses: nick-fields/retry@v3.0.2
with:
shell: bash
command: npm run test:snapshots -- --update-snapshots
command: npm run test:snapshots
timeout_minutes: 5
max_attempts: 5
env:
@ -158,6 +158,17 @@ jobs:
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
TARGET: web
- name: Update snapshots
if: always()
run: npm run test:snapshots -- --last-failed --update-snapshots
env:
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
TARGET: web
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
with:

View File

@ -238,6 +238,26 @@ test.describe('when using the file tree to', () => {
}
)
test(
`create new folders and that doesn't trigger a navigation`,
{ tag: ['@electron', '@macos', '@windows'] },
async ({ page, homePage, scene, toolbar, cmdBar }) => {
await homePage.goToModelingScene()
await scene.settled(cmdBar)
await toolbar.openPane('files')
const { createNewFolder } = await getUtils(page, test)
await createNewFolder('folder')
await createNewFolder('folder.kcl')
await test.step(`Postcondition: folders are created and we didn't navigate`, async () => {
await toolbar.expectFileTreeState(['folder', 'folder.kcl', 'main.kcl'])
await expect(toolbar.fileName).toHaveText('main.kcl')
})
}
)
test(
'deleting all files recreates a default main.kcl with no code',
{ tag: '@electron' },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View File

@ -557,6 +557,14 @@ export async function getUtils(page: Page, test_?: typeof test) {
})
},
createNewFolder: async (name: string) => {
return test?.step(`Create a folder named ${name}`, async () => {
await page.getByTestId('create-folder-button').click()
await page.getByTestId('tree-input-field').fill(name)
await page.keyboard.press('Enter')
})
},
cloneFile: async (name: string) => {
return test?.step(`Cloning file '${name}'`, async () => {
await page

View File

@ -654,7 +654,12 @@ export const useFileTreeOperations = () => {
send({
type: 'Create file',
data: { name: args.name, makeDir: true, shouldSetToRename: false },
data: {
name: args.name,
makeDir: true,
silent: true,
shouldSetToRename: false,
},
})
}