feat: expand EasyCode software factory workflows
This commit is contained in:
24
RuoYi-Vue/ruoyi-ui/test/pageThemeView.test.mjs
Normal file
24
RuoYi-Vue/ruoyi-ui/test/pageThemeView.test.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
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/pageTheme/index.vue'), 'utf8')
|
||||
|
||||
test('page theme admin edits frontend and admin navigation independently', () => {
|
||||
assert.match(source, /label="前台菜单"/)
|
||||
assert.match(source, /v-model="shellForm\.frontendNavigation"/)
|
||||
assert.match(source, /label="后台菜单"/)
|
||||
assert.match(source, /v-model="shellForm\.adminNavigation"/)
|
||||
assert.doesNotMatch(source, /v-model="shellForm\.navigation"/)
|
||||
})
|
||||
|
||||
test('page theme admin migrates legacy shared navigation on edit', () => {
|
||||
assert.match(source, /parseShell\(json\)/)
|
||||
assert.match(source, /raw\.frontendNavigation \|\| legacyNavigation/)
|
||||
assert.match(source, /raw\.adminNavigation \|\| legacyNavigation/)
|
||||
assert.match(source, /delete result\.navigation/)
|
||||
assert.match(source, /delete shell\.navigation/)
|
||||
})
|
||||
Reference in New Issue
Block a user