Always give new files and dirs a new index if their names are taken (#3460)
* Add actual support for makeUnique parameter * Add uniqueness logic to dirs, make text-to-cad receive unique filename * No longer need makeUnique flag, it's always on * fmt * Don't show toast when name hasn't changed during a rename * fmt * Get "interact with many" text-to-cad test passing again * Get "engine fails export" back to reliably green * Maybe more stable click target for text-to-cad test * Make "export is already going" test moderately more reliable * Mark "export is already going" as fixme * Undo that fixme thing I take it back
This commit is contained in:
@ -85,6 +85,7 @@ import {
|
||||
} from 'lang/std/engineConnection'
|
||||
import { submitAndAwaitTextToKcl } from 'lib/textToCad'
|
||||
import { useFileContext } from 'hooks/useFileContext'
|
||||
import { PLAYWRIGHT_MOCK_EXPORT_DURATION } from 'lib/constants'
|
||||
|
||||
type MachineContext<T extends AnyStateMachine> = {
|
||||
state: StateFrom<T>
|
||||
@ -393,10 +394,24 @@ export const ModelingMachineProvider = ({
|
||||
selection: { type: 'default_scene' },
|
||||
}
|
||||
|
||||
const mockExportDuration = window.localStorage.getItem(
|
||||
PLAYWRIGHT_MOCK_EXPORT_DURATION
|
||||
)
|
||||
|
||||
console.log('mockExportDuration', mockExportDuration)
|
||||
|
||||
// Artificially delay the export in playwright tests
|
||||
toast.promise(
|
||||
exportFromEngine({
|
||||
format: format,
|
||||
}),
|
||||
Promise.all([
|
||||
exportFromEngine({
|
||||
format: format,
|
||||
}),
|
||||
mockExportDuration
|
||||
? new Promise((resolve) =>
|
||||
setTimeout(resolve, Number(mockExportDuration))
|
||||
)
|
||||
: Promise.resolve(),
|
||||
]),
|
||||
{
|
||||
loading: 'Starting print...',
|
||||
success: 'Started print successfully',
|
||||
|
Reference in New Issue
Block a user