feat: add CountEntries to skip decryption for list --detail (#562)

* feat: add CountEntries to skip decryption for list --detail (#549)
* test: add CountEntries and countCategory tests at browser level
* fix: address review feedback on CountRows and countLocalStorage
* test: add CountRows unit tests
This commit is contained in:
Roger
2026-04-07 22:28:39 +08:00
committed by GitHub
parent 5f42d4fe5f
commit b3bbc0dadf
40 changed files with 1009 additions and 101 deletions
+10
View File
@@ -196,6 +196,16 @@ func insertCreditCard(name string, month, year int, encNumberHex, nickName, addr
// Test fixture builders
// ---------------------------------------------------------------------------
// installFile copies a test fixture file into a profile directory.
// This bridges per-category setup functions (which return standalone paths)
// and browser-level integration tests (which need files inside a profile).
func installFile(t *testing.T, profileDir, srcPath, dstName string) {
t.Helper()
data, err := os.ReadFile(srcPath)
require.NoError(t, err)
require.NoError(t, os.WriteFile(filepath.Join(profileDir, dstName), data, 0o644))
}
// createTestDB creates a SQLite database with the given schema and insert statements.
func createTestDB(t *testing.T, name, schema string, inserts ...string) string {
t.Helper()