12 lines
553 B
JavaScript
12 lines
553 B
JavaScript
const test = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
const { matches } = require('./saved-page.js');
|
|
test('saved filtering matches title and channel without changing the library', () => {
|
|
const video = { id: 'one', title: 'A quiet morning', channel: 'Studio sessions' };
|
|
assert.equal(matches(video, 'QUIET'), true);
|
|
assert.equal(matches(video, 'studio'), true);
|
|
assert.equal(matches(video, 'evening'), false);
|
|
assert.equal(matches({ id: 'unknown' }, 'unknown'), true);
|
|
assert.equal(matches(video, ''), true);
|
|
});
|