Files
Telegram-Panel/frontend/tests/mainLayoutMenu.test.mjs
jack 68a7d50516 release: 发布 v1.31.71 Telegram API 设置入口修复
发布 v1.31.71,修正 Telegram API 设置入口与轮询。
2026-08-20 20:33:05 +08:00

21 lines
986 B
JavaScript

import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import test from 'node:test'
const sourceUrl = new URL('../src/layouts/MainLayout.vue', import.meta.url)
const source = await readFile(sourceUrl, 'utf8')
test('侧栏子菜单默认全部收起', () => {
assert.match(source, /const defaultOpeneds: string\[\] = \[\]/)
assert.equal(source.match(/:default-openeds="defaultOpeneds"/g)?.length, 2)
})
test('Telegram API 回到系统设置且设备指纹保留独立入口', async () => {
const routerSource = await readFile(new URL('../src/router/index.ts', import.meta.url), 'utf8')
const settingsSource = await readFile(new URL('../src/views/Settings.vue', import.meta.url), 'utf8')
assert.doesNotMatch(source, /label: 'Telegram API'/)
assert.match(source, /label: '设备指纹'/)
assert.match(routerSource, /path: 'telegram-api', redirect: '\/settings'/)
assert.match(settingsSource, /<template #header>Telegram API<\/template>/)
})