From ea2bfc2dc6fc199ecba403ae9cba2b327be7fba4 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Wed, 16 Oct 2019 11:32:32 +0200 Subject: [PATCH] Redtest: matchesSavedMap matchDomainOnly without host prefix --- src/__tests__/utils.spec.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/__tests__/utils.spec.js b/src/__tests__/utils.spec.js index cd10d81..78e86db 100644 --- a/src/__tests__/utils.spec.js +++ b/src/__tests__/utils.spec.js @@ -63,4 +63,29 @@ describe('utils', () => { }); + describe('matchesSavedMap', () => { + describe('matchDomainOnly', () => { + describe('without host prefix', () => { + const url = 'https://duckduckgo.com'; + const host = 'duckduckgo.com'; + const matchDomainOnly = true; + it('should match url without path', () => { + expect( + utils.matchesSavedMap(url, matchDomainOnly, {host}) + ).toBeTruthy(); + }); + }); + }); + describe('without host prefix', () => { + it('should match url without path', () => { + const url = 'https://duckduckgo.com'; + const host = 'duckduckgo.com'; + const matchDomainOnly = false; + expect( + utils.matchesSavedMap(url, matchDomainOnly, {host}) + ).toBeTruthy(); + }); + }); + }); + });