Files
KanbanGit/native/tests/navigation-macos.test.js
T
Twyco 1082b6ac82
CI/CD / preconditions (pull_request) Successful in 6s
Native JavaScript checks / Native launcher and release tests (pull_request) Successful in 3m43s
macOS checks / Native Rust tests and unsigned build (pull_request) Canceled after 0s
CI/CD / Publish immutable image (pull_request) Canceled after 0s
CI/CD / test_and_check_app (pull_request) Canceled after 1m36s
fix: restore macOS navigation with unsaved forms
2026-10-15 08:56:29 +02:00

59 lines
1.9 KiB
JavaScript

import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import { mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import process from 'node:process';
import test from 'node:test';
import { fileURLToPath } from 'node:url';
test(
'WebKit preserves history and confirms dirty form navigation without losing delegate callbacks',
{ skip: process.platform !== 'darwin' },
() => {
const directory = mkdtempSync(join(tmpdir(), 'kanbangit-navigation-'));
const binary = join(directory, 'navigation-test');
try {
const compile = spawnSync(
'xcrun',
[
'--sdk',
'macosx',
'clang',
'-fobjc-arc',
'-fblocks',
'-Wall',
'-Werror',
'-framework',
'AppKit',
'-framework',
'WebKit',
fileURLToPath(
new URL('./navigation-macos.m', import.meta.url),
),
'-o',
binary,
],
{ encoding: 'utf8', timeout: 30000 },
);
assert.equal(
compile.status,
0,
compile.stderr || compile.error?.message,
);
const result = spawnSync(binary, [], {
encoding: 'utf8',
timeout: 30000,
});
assert.equal(
result.status,
0,
result.stderr || result.error?.message || result.signal,
);
assert.match(result.stdout, /PASS: WebKit/);
} finally {
rmSync(directory, { recursive: true, force: true });
}
},
);