1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 04:03:29 +00:00

Add test for DDG

This commit is contained in:
Todd Martin
2025-06-05 16:24:24 -04:00
parent a1cb6bb639
commit 4d06ceb8fb

View File

@@ -121,6 +121,16 @@ describe("Browser Utils Service", () => {
expect(browserPlatformUtilsService.getDevice()).toBe(DeviceType.VivaldiExtension);
});
it("should detect duckduckgo", () => {
Object.defineProperty(navigator, "userAgent", {
configurable: true,
value:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15 Ddg/18.4",
});
expect(browserPlatformUtilsService.getDevice()).toBe(DeviceType.DuckDuckGoExtension);
});
it("returns a previously determined device using a cached value", () => {
Object.defineProperty(navigator, "userAgent", {
configurable: true,