Help Modal
This commit is contained in:
1 parent
8e8aa5f27c
commit
8d987d1526
11 files changed
+2405
-58
No files matched your search
@@ -2,7 +2,7 @@
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { PhArrowClockwise, PhCheck, PhClipboardText, PhWarning, PhX } from '@phosphor-icons/vue'
|
||||
import { useSceneStore } from '@/stores/scene'
|
||||
import { t } from '@/i18n'
|
||||
import { t, useI18n } from '@/i18n'
|
||||
import { runAll, type TestResult } from './testRunner'
|
||||
import { registerAllTests } from './tests'
|
||||
|
||||
@@ -140,6 +140,13 @@ async function run() {
|
||||
clipboardStatus.value = 'idle'
|
||||
startedAt.value = performance.now()
|
||||
const snapshot = JSON.parse(JSON.stringify(store.$state))
|
||||
// The test harness asserts against English UI strings (aria-labels,
|
||||
// section titles, help dialog headings, "yet"/"unsaved" substrings).
|
||||
// Pin the locale to 'en' for the duration of the run so a German
|
||||
// browser default doesn't flip them all red. Restore on finally.
|
||||
const { locale } = useI18n()
|
||||
const prevLocale = locale.value
|
||||
locale.value = 'en'
|
||||
try {
|
||||
await runAll(registerAllTests, {
|
||||
onProgress: (d, t) => {
|
||||
@@ -160,6 +167,7 @@ async function run() {
|
||||
})
|
||||
} finally {
|
||||
store.$state = snapshot
|
||||
locale.value = prevLocale
|
||||
finishedAt.value = performance.now()
|
||||
running.value = false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user