Files
go_bt/tests/toolbar_fixed_rows.test.js

21 lines
1.0 KiB
JavaScript

'use strict';
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const root = path.join(__dirname, '..');
const html = fs.readFileSync(path.join(root, 'public', 'index.html'), 'utf8');
const css = fs.readFileSync(path.join(root, 'public', 'style.css'), 'utf8');
assert.strictEqual((html.match(/class="toolbar-line /g) || []).length, 2, '账号和操作应固定为两行');
assert.strictEqual((html.match(/class="action-line /g) || []).length, 2, '任务和打开应固定为两行');
assert.match(html, /toolbar-line--accounts[\s\S]*btn-group-label">账号[\s\S]*btn-group-label">搜索/);
assert.match(html, /toolbar-line--operations[\s\S]*btn-group-label">操作/);
assert.match(html, /action-line--tasks[\s\S]*btn-group-label">任务/);
assert.match(html, /action-line--open[\s\S]*btn-group-label">打开/);
assert.match(css, /\.toolbar-stack\s*\{[\s\S]*?flex-direction:\s*column/);
assert.match(css, /\.action-row\s*\{[\s\S]*?flex-direction:\s*column/);
console.log('toolbar_fixed_rows.test.js: PASS');