mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
21 lines
782 B
JavaScript
21 lines
782 B
JavaScript
import { describe, expect, it } from 'vitest';
|
|
import { isTabUrlFiltered } from './tab-filter.js';
|
|
|
|
const blacklist = ['google.com', 'mail.google.com'];
|
|
const allowlist = ['drive.google.com'];
|
|
|
|
describe('tab URL filtering', () => {
|
|
it('keeps Google Drive selectable despite the google.com parent-domain rule', () => {
|
|
expect(isTabUrlFiltered(
|
|
'https://drive.google.com/drive/u/1/search?q=mp4',
|
|
blacklist,
|
|
allowlist
|
|
)).toBe(false);
|
|
});
|
|
|
|
it('continues to filter other Google subdomains', () => {
|
|
expect(isTabUrlFiltered('https://mail.google.com/mail/u/0/', blacklist, allowlist)).toBe(true);
|
|
expect(isTabUrlFiltered('https://www.google.com/search?q=video', blacklist, allowlist)).toBe(true);
|
|
});
|
|
});
|