mirror of
https://github.com/wekan/wekan.git
synced 2026-11-20 14:45:01 -05:00
Match literal text across the authorized board, including cards outside lazy windows. Publish only matching IDs, refresh on content and access changes, and release observers when filters change. Verify the batched join, cancellation and permission races, and actual Chromium behavior. Thanks to neooleg and xet7 !
19 lines
907 B
JavaScript
19 lines
907 B
JavaScript
'use strict';
|
|
const { test } = require('node:test');
|
|
const assert = require('node:assert/strict');
|
|
test('text filtering combines with existing constraints and survives board navigation until reset', async () => {
|
|
const { register } = require('node:module');
|
|
const { pathToFileURL } = require('node:url');
|
|
const path = require('node:path');
|
|
register(pathToFileURL(path.join(__dirname, 'helpers/meteorStubLoader.mjs')), pathToFileURL(__filename));
|
|
const { Filter } = await import('../client/lib/filter.js');
|
|
Filter.reset(); Filter.text.set('needle');
|
|
assert.equal(Filter.isActive(), true);
|
|
assert.deepEqual(Filter._getMongoSelector(), { _id: { $in: ['needle'] } });
|
|
Filter.labelIds.add('red');
|
|
assert.equal(Filter._getMongoSelector().$and.length, 2);
|
|
Filter.resetBoardScoped();
|
|
assert.equal(Filter.text.value(), 'needle');
|
|
Filter.reset(); assert.equal(Filter.isActive(), false);
|
|
});
|