25 lines
956 B
JavaScript
25 lines
956 B
JavaScript
import assert from "node:assert/strict";
|
|
import { readFile } from "node:fs/promises";
|
|
import test from "node:test";
|
|
|
|
const migrationUrl = new URL(
|
|
"../migrations/015_device_integration_identity.sql",
|
|
import.meta.url,
|
|
);
|
|
const repositoryUrl = new URL("../src/postgres-repository.mjs", import.meta.url);
|
|
|
|
test("integration identity is stored separately from display name and restricted identifiers", async () => {
|
|
const sql = await readFile(migrationUrl, "utf8");
|
|
assert.match(sql, /add column if not exists integration_device_id text/i);
|
|
assert.doesNotMatch(sql, /insert\s+into/i);
|
|
assert.doesNotMatch(sql, /dcctouch|arusnavi|\bb2\b|imei|gelios/i);
|
|
});
|
|
|
|
test("integration identity migration follows registry profile commands", async () => {
|
|
const source = await readFile(repositoryUrl, "utf8");
|
|
assert.ok(
|
|
source.indexOf("014_device_registry_profile_commands.sql")
|
|
< source.indexOf("015_device_integration_identity.sql"),
|
|
);
|
|
});
|