You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
873 B
JavaScript
16 lines
873 B
JavaScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
const root = resolve(import.meta.dirname, "..");
|
|
const sidebar = readFileSync(resolve(root, "src/layout/components/Sidebar/index.vue"), "utf8");
|
|
const styles = readFileSync(resolve(root, "src/assets/styles/sidebar.scss"), "utf8");
|
|
|
|
assert.match(sidebar, /teacher-sidebar-toggle/, "教师侧栏应提供收起与展开按钮");
|
|
assert.match(sidebar, /toggleSideBar\(/, "收起按钮应复用全局侧栏状态");
|
|
assert.match(sidebar, /isCollapse/, "收起状态应同步到教师侧栏样式");
|
|
assert.match(styles, /&\.hideSidebar/, "教师侧栏收起时应缩小侧栏并回收内容区空间");
|
|
assert.match(styles, /\.teacher-sidebar-toggle/, "收起按钮应有教师端专属样式");
|
|
|
|
console.log("teacher sidebar can collapse to an icon rail");
|