24 lines
930 B
JavaScript
24 lines
930 B
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { dirname, resolve } from 'node:path'
|
|
|
|
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
const source = readFileSync(resolve(currentDir, '../src/views/generator/templateBundle/index.vue'), 'utf8')
|
|
|
|
test('template bundle admin page edits preview image with image upload', () => {
|
|
assert.match(source, /prop="previewImage"/)
|
|
assert.match(source, /<ImageUpload/)
|
|
assert.match(source, /v-model="form\.previewImage"/)
|
|
assert.match(source, /:limit="1"/)
|
|
assert.match(source, /previewImage:\s*null/)
|
|
})
|
|
|
|
test('template bundle admin page lists preview image thumbnail', () => {
|
|
assert.match(source, /prop="previewImage"/)
|
|
assert.match(source, /<el-image/)
|
|
assert.match(source, /scope\.row\.previewImage/)
|
|
assert.match(source, /templateBundleImageUrl/)
|
|
})
|