Files
image-workbench-desktop/tests/home-canvas-library-test.js
T

15 lines
913 B
JavaScript

'use strict'
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const source = fs.readFileSync(path.join(__dirname, '..', 'app.js'), 'utf8')
const css = fs.readFileSync(path.join(__dirname, '..', 'style.css'), 'utf8')
for (const text of ['导出选中', '删除选中', '导入画布', '新建画布', '重命名画布', '删除画布', '设置分类', '清空回收站']) assert.ok(source.includes(text), text)
assert.ok(!source.includes("className: 'iwb-home-card-check'"))
assert.ok(source.includes('const [homeSelectedWs, setHomeSelectedWs] = useState([])'))
assert.ok(source.includes('homeSelectedWs.includes(w.id)'))
assert.ok(source.includes("homeSelectedWs.forEach((id) => (homeView === 'trash' ? purgeWs(id) : trashWs(id)))"))
assert.ok(css.includes('.iwb-home-head'))
assert.ok(css.includes('.iwb-home-card-actions'))
console.log('home canvas library checks passed')