Files
OmniRoute/tests/unit/provider-section-visibility.test.ts
nguyenha935 aaddfcd545 fix(providers): unify connection and routing flows (#7629)
* fix(providers): unify connection and routing flows

* docs(changelog): add provider flow consistency entry

* test(providers): move section-visibility cases to own file (test file-size cap)

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* refactor(api): extract fetchLiveNoAuthModels + toLiveModel helpers (cognitive-complexity gate on buildNoAuthModelsResponse)

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-18 21:20:09 -03:00

18 lines
784 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
const providerPageUtils = await import(
"../../src/app/(dashboard)/dashboard/providers/providerPageUtils.ts"
);
test("default provider view hides cross-cutting sections that duplicate primary cards", () => {
const { shouldShowProviderSection } = providerPageUtils;
assert.equal(shouldShowProviderSection("oauth", null, false), true);
assert.equal(shouldShowProviderSection("free", null, false), false);
assert.equal(shouldShowProviderSection("webfetch", null, false), false);
assert.equal(shouldShowProviderSection("webfetch", "webfetch", false), true);
assert.equal(shouldShowProviderSection("free", null, true), true);
assert.equal(shouldShowProviderSection("oauth", null, true), false);
});