feat: inital implementation
This commit is contained in:
commit
924f57fe03
37 files changed
+4815
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
import { parseOverlayLibrary } from '../src/utils/overlayConfig.ts'
|
||||
|
||||
test('parseOverlayLibrary accepts simple local raster files', () => {
|
||||
assert.deepEqual(
|
||||
parseOverlayLibrary([{ id: 'crr', name: ' CRR Logo ', file: 'crr-logo.png' }]),
|
||||
[{ id: 'crr', name: 'CRR Logo', file: 'crr-logo.png' }],
|
||||
)
|
||||
})
|
||||
|
||||
test('parseOverlayLibrary rejects duplicate ids', () => {
|
||||
assert.throws(() => parseOverlayLibrary([
|
||||
{ id: 'crr', name: 'One', file: 'one.png' },
|
||||
{ id: 'crr', name: 'Two', file: 'two.png' },
|
||||
]))
|
||||
})
|
||||
|
||||
test('parseOverlayLibrary rejects paths, URLs, and SVG files', () => {
|
||||
for (const file of ['../logo.png', 'nested/logo.png', 'https://example.test/logo.png', 'logo.svg']) {
|
||||
assert.throws(() => parseOverlayLibrary([{ id: 'bad', name: 'Bad', file }]))
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user