feat: add icloud fetch mode control to sidepanel and corresponding test

This commit is contained in:
QLHazyCoder
2026-04-24 23:28:24 +08:00
parent cdb870b27d
commit 58d8779f12
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -140,6 +140,7 @@ const btnIcloudLoginDone = document.getElementById('btn-icloud-login-done');
const btnIcloudRefresh = document.getElementById('btn-icloud-refresh');
const btnIcloudDeleteUsed = document.getElementById('btn-icloud-delete-used');
const selectIcloudHostPreference = document.getElementById('select-icloud-host-preference');
const selectIcloudFetchMode = document.getElementById('select-icloud-fetch-mode');
const checkboxAutoDeleteIcloud = document.getElementById('checkbox-auto-delete-icloud');
const inputIcloudSearch = document.getElementById('input-icloud-search');
const selectIcloudFilter = document.getElementById('select-icloud-filter');
+7
View File
@@ -12,6 +12,13 @@ test('sidepanel loads icloud manager before sidepanel bootstrap', () => {
assert.ok(icloudManagerIndex < sidepanelIndex);
});
test('sidepanel source binds the icloud fetch mode control before using it', () => {
const source = fs.readFileSync('sidepanel/sidepanel.js', 'utf8');
assert.match(source, /const selectIcloudFetchMode = document\.getElementById\('select-icloud-fetch-mode'\);/);
assert.match(source, /selectIcloudFetchMode\?\.addEventListener\('change'/);
});
test('icloud manager exposes a factory and renders empty state', () => {
const source = fs.readFileSync('sidepanel/icloud-manager.js', 'utf8');
const windowObject = {};