diff --git a/package-lock.json b/package-lock.json index 69f4a807..c0c50ba9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@tauri-apps/plugin-dialog": "^2.8.3", "@tauri-apps/plugin-fs": "^2.7.1", "dompurify": "^3.4.16", - "foundation-ui": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/a79bbdf0066bb65a6d200a251a20cc9ca13cc936", + "foundation-ui": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/9c8109897ec0137e5a1ce671f794c8913fb02f0e", "markdown-it": "^14.3.2", "pixi.js": "^8.19.0", "qrcode": "^1.5.4", @@ -1608,7 +1608,7 @@ }, "node_modules/foundation-ui": { "version": "0.1.0", - "resolved": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/a79bbdf0066bb65a6d200a251a20cc9ca13cc936", + "resolved": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/9c8109897ec0137e5a1ce671f794c8913fb02f0e", "license": "MPL-2.0", "dependencies": { "@material/material-color-utilities": "^0.4.0", diff --git a/package.json b/package.json index 31cae1d7..baf08635 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@tauri-apps/plugin-dialog": "^2.8.3", "@tauri-apps/plugin-fs": "^2.7.1", "dompurify": "^3.4.16", - "foundation-ui": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/a79bbdf0066bb65a6d200a251a20cc9ca13cc936", + "foundation-ui": "https://codeload.github.com/AlkaidLab/foundation-ui/tar.gz/9c8109897ec0137e5a1ce671f794c8913fb02f0e", "markdown-it": "^14.3.2", "pixi.js": "^8.19.0", "qrcode": "^1.5.4", diff --git a/src/renderer/brandAssets.test.js b/src/renderer/brandAssets.test.js new file mode 100644 index 00000000..8bce091b --- /dev/null +++ b/src/renderer/brandAssets.test.js @@ -0,0 +1,23 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' + +// foundation-ui draws no picture of 薇薇 and has no wallpaper of hers until a product registers them: the windows that show her do it, the others carry none of her files +const read = (path) => readFileSync(new URL(path, import.meta.url), 'utf8') +const registers = (path) => /import \{ registerViviAssets \} from 'foundation-ui\/brand-assets'/.test(read(path)) && /^registerViviAssets\(\)$/m.test(read(path)) + +test('the desktop window and the installer page register 薇薇 and her wallpapers before they mount', () => { + for (const main of ['desktop/main.js', 'installer/main.js']) assert.ok(registers(main), main) + assert.ok(read('desktop/main.js').indexOf('registerViviAssets()') < read('desktop/main.js').indexOf('createApp(App)')) +}) + +test('the small windows (menu, toolbar, pin, latency clock, launch splash, tool window, home) do not import the art', () => { + for (const main of ['ctxmenu', 'toolbar', 'pin', 'latency-clock', 'launch-splash', 'tool-window', 'home']) assert.doesNotMatch(read(`${main}/main.js`), /brand-assets/, main) +}) + +test('the components that show the product name get it from the panel', () => { + assert.match(read('config/brand.js'), /PRODUCT_NAME = 'Foundation Sunshine'/) + assert.match(read('components/SidebarMenu.vue'), / - + @@ -15,7 +15,7 @@
- +