Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add test identifiers for easier cross-platform maintenance (#1120)
Leendert de Borst48c5a5e38ad7
diff --git a/apps/browser-extension/src/entrypoints/contentScript/__tests__/Filter.test.ts b/apps/browser-extension/src/entrypoints/contentScript/__tests__/Filter.test.tsindex a836a1618..910bb6148 100644--- a/apps/browser-extension/src/entrypoints/contentScript/__tests__/Filter.test.ts+++ b/apps/browser-extension/src/entrypoints/contentScript/__tests__/Filter.test.ts@@ -12,6 +12,7 @@ describe('Filter - Credential URL Matching', () => {testCredentials = createSharedTestCredentials();});+ // [#1] - Exact URL matchit('should match exact URL', () => {const matches = filterCredentials(testCredentials,@@ -23,6 +24,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Coolblue');});+ // [#2] - Base URL with path matchit('should match base URL with path', () => {const matches = filterCredentials(testCredentials,@@ -34,6 +36,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Gmail');});+ // [#3] - Root domain with subdomain matchit('should match root domain with subdomain', () => {const matches = filterCredentials(testCredentials,@@ -45,6 +48,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Google');});+ // [#4] - No matches for non-existent domainit('should return empty array for no matches', () => {const matches = filterCredentials(testCredentials,@@ -55,7 +59,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches).toHaveLength(0);});- // New comprehensive test cases+ // [#5] - Partial URL stored matches full URL searchit('should match partial URL with full URL - dumpert.nl case', () => {// Test case: stored URL is "dumpert.nl", search with full URLconst matches = filterCredentials(@@ -68,6 +72,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Dumpert');});+ // [#6] - Full URL stored matches partial URL searchit('should match full URL with partial URL', () => {// Test case: stored URL is full, search with partialconst matches = filterCredentials(@@ -80,6 +85,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Coolblue');});+ // [#7] - Protocol variations (http/https/none) matchit('should handle protocol variations correctly', () => {// Test that http and https variations matchconst httpsMatches = filterCredentials(@@ -106,6 +112,7 @@ describe('Filter - Credential URL Matching', () => {expect(noProtocolMatches[0].ServiceName).toBe('GitHub');});+ // [#8] - WWW prefix variations matchit('should handle www variations correctly', () => {// Test that www variations matchconst withWww = filterCredentials(@@ -125,6 +132,7 @@ describe('Filter - Credential URL Matching', () => {expect(withoutWww[0].ServiceName).toBe('Dumpert');});+ // [#9] - Subdomain matchingit('should handle subdomain matching', () => {// Test subdomain matchingconst appSubdomain = filterCredentials(@@ -151,6 +159,7 @@ describe('Filter - Credential URL Matching', () => {expect(noSubdomain[0].ServiceName).toBe('Subdomain Example');});+ // [#10] - Paths and query strings ignoredit('should ignore paths and query strings', () => {// Test that paths and query strings are ignoredconst withPath = filterCredentials(@@ -177,6 +186,7 @@ describe('Filter - Credential URL Matching', () => {expect(withFragment[0].ServiceName).toBe('Gmail');});+ // [#11] - Complex URL variationsit('should handle complex URL variations', () => {// Test complex URL matching scenarioconst complexUrl = filterCredentials(@@ -189,6 +199,7 @@ describe('Filter - Credential URL Matching', () => {expect(complexUrl[0].ServiceName).toBe('Coolblue');});+ // [#12] - Priority ordering (exact over partial)it('should prioritize exact matches over partial matches', () => {// Add a credential with exact domain match to test priorityconst credentialsWithExact = [@@ -212,6 +223,7 @@ describe('Filter - Credential URL Matching', () => {expect(matches[0].ServiceName).toBe('Exact Match');});+ // [#13] - Title-only matchingit('should match title only', () => {const matches = filterCredentials(testCredentials,diff --git a/apps/mobile-app/ios/VaultUITests/CredentialFilterTests.swift b/apps/mobile-app/ios/VaultUITests/CredentialFilterTests.swiftindex 61aae1709..73fdee79c 100644--- a/apps/mobile-app/ios/VaultUITests/CredentialFilterTests.swift+++ b/apps/mobile-app/ios/VaultUITests/CredentialFilterTests.swift@@ -17,6 +17,7 @@ final class CredentialFilterTests: XCTestCase {super.tearDown()}+ // [#1] - Exact URL matchfunc testExactUrlMatch() {let matches = filterCredentials(testCredentials, searchText: "www.coolblue.nl")@@ -24,6 +25,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(matches.first?.service.name, "Coolblue")}+ // [#2] - Base URL with path matchfunc testBaseUrlMatch() {let matches = filterCredentials(testCredentials, searchText: "https://gmail.com/signin")@@ -31,6 +33,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(matches.first?.service.name, "Gmail")}+ // [#3] - Root domain with subdomain matchfunc testRootDomainMatch() {let matches = filterCredentials(testCredentials, searchText: "https://mail.google.com")@@ -38,6 +41,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(matches.first?.service.name, "Google")}+ // [#4] - No matches for non-existent domainfunc testNoMatches() {let matches = filterCredentials(testCredentials, searchText: "https://nonexistent.com")@@ -45,6 +49,7 @@ final class CredentialFilterTests: XCTestCase {}// New comprehensive test cases+ // [#5] - Partial URL stored matches full URL searchfunc testPartialUrlMatchWithFullUrl() {// Test case: stored URL is "dumpert.nl", search with full URLlet matches = filterCredentials(testCredentials, searchText: "https://www.dumpert.nl")@@ -53,6 +58,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(matches.first?.service.name, "Dumpert")}+ // [#6] - Full URL stored matches partial URL searchfunc testFullUrlMatchWithPartialUrl() {// Test case: stored URL is full, search with partiallet matches = filterCredentials(testCredentials, searchText: "coolblue.nl")@@ -61,6 +67,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertTrue(matches.contains { $0.service.name == "Coolblue" })}+ // [#7] - Protocol variations (http/https/none) matchfunc testProtocolVariations() {// Test that http and https variations matchlet httpsMatches = filterCredentials(testCredentials, searchText: "https://github.com")@@ -75,6 +82,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(noProtocolMatches.first?.service.name, "GitHub")}+ // [#8] - WWW prefix variations matchfunc testWwwVariations() {// Test that www variations matchlet withWww = filterCredentials(testCredentials, searchText: "www.dumpert.nl")@@ -86,6 +94,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(withoutWww.first?.service.name, "Dumpert")}+ // [#9] - Subdomain matchingfunc testSubdomainMatching() {// Test subdomain matchinglet appSubdomain = filterCredentials(testCredentials, searchText: "https://app.example.com")@@ -100,6 +109,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(noSubdomain.first?.service.name, "Subdomain Example")}+ // [#10] - Paths and query strings ignoredfunc testPathAndQueryIgnored() {// Test that paths and query strings are ignoredlet withPath = filterCredentials(testCredentials, searchText: "https://github.com/user/repo")@@ -114,6 +124,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertEqual(withFragment.first?.service.name, "Gmail")}+ // [#11] - Complex URL variationsfunc testComplexUrlVariations() {// Test complex URL matching scenariolet matches = filterCredentials(testCredentials, searchText: "https://www.coolblue.nl/product/12345?ref=google")@@ -122,6 +133,7 @@ final class CredentialFilterTests: XCTestCase {XCTAssertTrue(matches.contains { $0.service.name == "Coolblue" })}+ // [#13] - Title-only matchingfunc testTitleOnlyMatching() {// Test service name matching when no URL is availablelet matches = filterCredentials(testCredentials, searchText: "newyorktimes")