31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { validateManifest } from '../scripts/manifest-v2.mjs'
|
|
|
|
const testDirectory = path.dirname(fileURLToPath(import.meta.url))
|
|
const pipelineDirectory = path.resolve(testDirectory, '..')
|
|
const workspace = path.resolve(pipelineDirectory, '..')
|
|
const manifestPath = path.join(pipelineDirectory, 'manifests', 'a01-scroll-skins-v3.json')
|
|
|
|
test('declares the approved A01 scroll-skin family', async () => {
|
|
const manifest = JSON.parse(await readFile(manifestPath, 'utf8'))
|
|
validateManifest(manifest, workspace)
|
|
|
|
assert.equal(manifest.assets.length, 4)
|
|
assert.deepEqual(
|
|
manifest.assets.map(({ id }) => id),
|
|
['a01-scroll-primary-v3', 'a01-scroll-secondary-v3', 'a01-scroll-toast-v3', 'a01-scroll-dialog-v3']
|
|
)
|
|
assert.deepEqual(
|
|
manifest.assets.map(({ outputPixels }) => [outputPixels.width, outputPixels.height]),
|
|
[[1866, 276], [1866, 300], [1770, 246], [1860, 1560]]
|
|
)
|
|
assert.equal(manifest.assets[2].assetClass, 'nine-slice')
|
|
assert.equal(manifest.assets[2].render.scalePolicy, 'nine-slice')
|
|
assert.equal(manifest.assets[3].render.uniMode, 'aspectFit')
|
|
assert(manifest.assets.every(({ consumers }) => consumers.includes('pages/auth/a01-entry.vue')))
|
|
})
|