Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

test(gui): cover render delay redirects and origin isolation

davoodmehraban89 committed Oct 16, 2026 at 22:49 UTC 2304699a20e3acd9ffd05fe8a12d96ac20e8a1ba
1 file changed +21
qa/windows/gui-readiness.node.mjs new
+21
@@ -0,0 +1,21 @@
1 +import test from 'node:test';
2 +import assert from 'node:assert/strict';
3 +import { isIntegrationsEditorReady } from './gui-readiness.mjs';
4 +
5 +const ready = { href:'http://127.0.0.1:3210/integrations', editor:true, copy:true };
6 +
7 +test('accepts a hydrated integrations editor with copy control', () => {
8 + assert.equal(isIntegrationsEditorReady(ready), true);
9 +});
10 +test('does not race ahead when navigation finished but editor is not hydrated', () => {
11 + assert.equal(isIntegrationsEditorReady({...ready, editor:false}), false);
12 + assert.equal(isIntegrationsEditorReady({...ready, copy:false}), false);
13 +});
14 +test('rejects a login redirect or another page', () => {
15 + assert.equal(isIntegrationsEditorReady({...ready, href:'http://127.0.0.1:3210/login'}), false);
16 +});
17 +test('rejects an unrelated origin or malformed data', () => {
18 + assert.equal(isIntegrationsEditorReady({...ready, href:'https://example.com/integrations'}), false);
19 + assert.equal(isIntegrationsEditorReady(null), false);
20 + assert.equal(isIntegrationsEditorReady({...ready, href:'not a URL'}), false);
21 +});