mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
Guard deferred swimlane setup after reactive view destruction, keep authenticated browser navigation inside the live application, and wait for Meteor before checking invalid verification tokens. Route database conformance through host Docker when running inside Flatpak and make card opening resilient to subscription rerenders.\n\nThanks to xet7 !
26 lines
907 B
JavaScript
26 lines
907 B
JavaScript
'use strict';
|
|
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
|
|
const source = fs.readFileSync(
|
|
path.resolve(__dirname, '..', 'client/components/swimlanes/swimlanes.js'),
|
|
'utf8',
|
|
);
|
|
|
|
const renderedBlocks = source.match(
|
|
/Template\.(?:swimlane|listsGroup)\.onRendered[\s\S]*?\n}\);/g,
|
|
) || [];
|
|
|
|
assert.equal(renderedBlocks.length, 2,
|
|
'both list-layout templates must have deferred initialization coverage');
|
|
for (const block of renderedBlocks) {
|
|
assert.match(block, /setTimeout\(\(\) => \{[\s\S]*?if \(tpl\.view\.isDestroyed\) return;/,
|
|
'deferred DOM work must stop after its Blaze view is destroyed');
|
|
}
|
|
assert.doesNotMatch(renderedBlocks[0], /setTimeout\([\s\S]*?tpl\.\$\('\.js-lists'\)/,
|
|
'the deferred swimlane callback must not select through a removed DomRange');
|
|
|
|
console.log('swimlaneDeferredInit: 4 assertions passed');
|