feat: 添加侧边栏贡献按钮,优化打开上传页面逻辑,更新相关测试

This commit is contained in:
QLHazyCoder
2026-04-19 00:51:36 +08:00
parent cf794e3fe0
commit 49707ffa74
7 changed files with 216 additions and 36 deletions
+1 -14
View File
@@ -54,7 +54,7 @@ test('sidepanel html contains contribution button in header', () => {
assert.match(html, />贡献</);
});
test('openContributionUploadPage confirms then opens upload page in a new tab', async () => {
test('openContributionUploadPage opens upload page in a new tab directly', async () => {
const bundle = [
extractFunction('openContributionUploadPage'),
].join('\n');
@@ -65,10 +65,6 @@ const CONTRIBUTION_UPLOAD_URL = 'https://apikey.qzz.io/';
function isContributionButtonLocked() {
return false;
}
async function openConfirmModal(options) {
calls.push({ type: 'confirm', options });
return true;
}
function openExternalUrl(url) {
calls.push({ type: 'open', url });
}
@@ -84,15 +80,6 @@ return {
const result = await api.openContributionUploadPage();
assert.equal(result, true);
assert.deepStrictEqual(api.getCalls(), [
{
type: 'confirm',
options: {
title: '账号贡献',
message: '确认打开账号贡献上传页面吗?',
confirmLabel: '前往上传',
confirmVariant: 'btn-primary',
},
},
{
type: 'open',
url: 'https://apikey.qzz.io/',