feat: 添加更新卡片提醒样式和测试

This commit is contained in:
QLHazyCoder
2026-04-24 23:57:08 +08:00
parent ee64f8202d
commit 6b9f3d9c44
3 changed files with 24 additions and 1 deletions
+12
View File
@@ -523,6 +523,18 @@ header {
line-height: 1.6;
}
.update-card-reminder {
margin: 0;
padding: 8px 10px;
border: 1px solid color-mix(in srgb, var(--orange) 28%, var(--border));
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--orange-soft) 70%, var(--bg-base));
color: var(--orange);
font-size: 12px;
font-weight: 700;
line-height: 1.5;
}
.update-release-list {
display: flex;
flex-direction: column;
+2 -1
View File
@@ -100,6 +100,7 @@
</div>
<button id="btn-open-release" class="btn btn-primary btn-sm" type="button">前往更新</button>
</div>
<p class="update-card-reminder">请更新前导出配置</p>
<div id="update-release-list" class="update-release-list"></div>
</div>
</section>
@@ -816,4 +817,4 @@
<script src="sidepanel.js"></script>
</body>
</html>
</html>
+10
View File
@@ -19,6 +19,16 @@ test('sidepanel source binds the icloud fetch mode control before using it', ()
assert.match(source, /selectIcloudFetchMode\?\.addEventListener\('change'/);
});
test('update card highlights exporting config before upgrade', () => {
const html = fs.readFileSync('sidepanel/sidepanel.html', 'utf8');
const css = fs.readFileSync('sidepanel/sidepanel.css', 'utf8');
assert.match(html, /<p class="update-card-reminder">请更新前导出配置<\/p>/);
assert.match(css, /\.update-card-reminder\s*\{/);
assert.match(css, /font-weight:\s*700;/);
assert.match(css, /color:\s*var\(--orange\);/);
});
test('icloud manager exposes a factory and renders empty state', () => {
const source = fs.readFileSync('sidepanel/icloud-manager.js', 'utf8');
const windowObject = {};