Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+52
@@ -0,0 +1,52 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
import type { IntegrationCatalogModel } from "@hivegrid/view-models";
|
||||
|
||||
import { renderIntegrationsCatalogMock } from "./index.js";
|
||||
|
||||
const model: IntegrationCatalogModel = {
|
||||
titleKey: "integrations.catalog.title",
|
||||
emptyHeadlineKey: "integrations.catalog.empty.headline",
|
||||
emptyBodyKey: "integrations.catalog.empty.body",
|
||||
canConnect: true,
|
||||
rowCount: 2,
|
||||
connectedCount: 1,
|
||||
rows: [
|
||||
{
|
||||
key: "sample-data-sync",
|
||||
titleKey: "integrations.app.sampleDataSync.title",
|
||||
category: "erp",
|
||||
categoryKey: "integrations.category.erp",
|
||||
connectionType: "rest_api",
|
||||
connectionCount: 2,
|
||||
detailHref: "/acme/integrations/sample-data-sync",
|
||||
},
|
||||
{
|
||||
key: "gmail",
|
||||
titleKey: "integrations.app.gmail.title",
|
||||
category: "communication",
|
||||
categoryKey: "integrations.category.communication",
|
||||
connectionType: "oauth2",
|
||||
connectionCount: 0,
|
||||
detailHref: "/acme/integrations/gmail",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
describe("renderIntegrationsCatalogMock (M017)", () => {
|
||||
test("renders normalized app rows with catalog data-attributes", () => {
|
||||
const html = renderIntegrationsCatalogMock(model);
|
||||
expect(html).toContain('data-ui-impl="mock"');
|
||||
expect(html).toContain('data-ui-id="ui.integrations.catalog"');
|
||||
expect(html).toContain('data-row-id="sample-data-sync"');
|
||||
expect(html).toContain('data-category-key="integrations.category.communication"');
|
||||
expect(html).toContain('data-connection-count="2"');
|
||||
expect(html).toContain('data-connected-count="1"');
|
||||
expect(html).toContain('data-can-connect="true"');
|
||||
});
|
||||
|
||||
test("renders the empty state as an i18n key", () => {
|
||||
const html = renderIntegrationsCatalogMock({ ...model, rows: [], rowCount: 0, connectedCount: 0 });
|
||||
expect(html).toContain('data-empty="true"');
|
||||
expect(html).toContain('data-i18n-key="integrations.catalog.empty.headline"');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user