fix(ci): repair qr test typing and mattermost setup status

This commit is contained in:
Peter Steinberger
2026-04-03 21:55:33 +01:00
parent 51eb877a15
commit eb6698002c
3 changed files with 13 additions and 4 deletions

View File

@@ -31,7 +31,9 @@ export const mattermostSetupWizard: ChannelSetupWizard = {
configuredScore: 2,
unconfiguredScore: 1,
resolveConfigured: ({ cfg, accountId }) =>
isMattermostConfigured(resolveMattermostAccountWithSecrets(cfg, accountId ?? undefined)),
isMattermostConfigured(
resolveMattermostAccountWithSecrets(cfg, accountId ?? DEFAULT_ACCOUNT_ID),
),
}),
introNote: {
title: "Mattermost bot token",

View File

@@ -1,13 +1,13 @@
import { Command } from "commander";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { encodePairingSetupCode } from "../pairing/setup-code.js";
import type { OutputRuntimeEnv } from "../runtime.js";
import type { CliMockOutputRuntime } from "./test-runtime-capture.js";
const runtimeState = vi.hoisted(() => {
const runtimeLogs: string[] = [];
const runtimeErrors: string[] = [];
const stringifyArgs = (args: unknown[]) => args.map((value) => String(value)).join(" ");
const defaultRuntime: OutputRuntimeEnv = {
const defaultRuntime: CliMockOutputRuntime = {
log: vi.fn((...args: unknown[]) => {
runtimeLogs.push(stringifyArgs(args));
}),

View File

@@ -2,15 +2,22 @@ import { Command } from "commander";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { RuntimeEnv } from "../runtime.js";
import { captureEnv } from "../test-utils/env.js";
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
const loadConfigMock = vi.hoisted(() => vi.fn());
const readConfigFileSnapshotMock = vi.hoisted(() => vi.fn());
const resolveGatewayPortMock = vi.hoisted(() => vi.fn(() => 18789));
const copyToClipboardMock = vi.hoisted(() => vi.fn(async () => false));
type CliRuntimeEnv = RuntimeEnv & {
log: MockFn<RuntimeEnv["log"]>;
error: MockFn<RuntimeEnv["error"]>;
exit: MockFn<RuntimeEnv["exit"]>;
};
const runtimeLogs: string[] = [];
const runtimeErrors: string[] = [];
const runtime = vi.hoisted<RuntimeEnv>(() => ({
const runtime = vi.hoisted<CliRuntimeEnv>(() => ({
log: (...args: unknown[]) => {
runtimeLogs.push(args.map(String).join(" "));
},