修改页面样式功能,首页样式功能导航栏样式功能等
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const source = fs.readFileSync(path.join(__dirname, '..', 'utils', 'CommonUtil.js'), 'utf8');
|
||||
|
||||
function assertContains(pattern, message) {
|
||||
if (!pattern.test(source)) {
|
||||
console.error(message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
assertContains(/topbar__btn--signin/, 'Expected public topbar to inject a sign-in button.');
|
||||
assertContains(/CommonUtil\.signIn\(/, 'Expected sign-in button to call CommonUtil.signIn().');
|
||||
assertContains(/text:\s*['"]\u7b7e\u5230['"]/, 'Expected sign-in button text to be sign in.');
|
||||
assertContains(/ensureTopbarSignInStyle/, 'Expected public topbar to install a dedicated sign-in button style.');
|
||||
assertContains(/\.topbar__btn--signin\s*\{/, 'Expected dedicated sign-in button CSS to be injected.');
|
||||
assertContains(/setTopbarSignInSigned/, 'Expected a shared helper to lock the topbar sign-in button.');
|
||||
assertContains(/\u5df2\u7b7e\u5230/, 'Expected signed state text to be already signed.');
|
||||
assertContains(/mineSignInStatus|\/api\/web\/mine\/sign-in\/status/, 'Expected topbar to load the current sign-in status.');
|
||||
assertContains(/\u5df2\u7b7e\u5230\|\u5df2\u7b7e\|\u5df2\u7ecf\u7b7e\u5230\|\u7b7e\u5230\u8fc7/, 'Expected already-signed API messages to lock the button.');
|
||||
|
||||
if (/class:\s*['"][^'"]*topbar__btn--signin[^'"]*topbar__btn--primary/.test(source)) {
|
||||
console.error('Expected sign-in button to use a quieter dedicated style, not the primary button style.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('topbar sign-in checks passed');
|
||||
Reference in New Issue
Block a user