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 { RolesListModel } from "@hivegrid/view-models";
|
||||
|
||||
import { renderRolesListMock } from "./index.js";
|
||||
|
||||
const model: RolesListModel = {
|
||||
titleKey: "settings.members.tabs.rolesAndPermissions",
|
||||
emptyHeadlineKey: "settings.rolesAndPermissions.empty.title",
|
||||
emptyBodyKey: "settings.rolesAndPermissions.empty.description",
|
||||
canCreate: true,
|
||||
rowCount: 2,
|
||||
rows: [
|
||||
{
|
||||
id: "sys",
|
||||
name: "SuperUser",
|
||||
typeLabelKey: "settings.rolesAndPermissions.type.system",
|
||||
memberCount: 2,
|
||||
permissionCount: 12,
|
||||
canEdit: false,
|
||||
canDelete: false,
|
||||
deleteBlockedInUse: false,
|
||||
},
|
||||
{
|
||||
id: "r-1",
|
||||
name: "Monteur",
|
||||
typeLabelKey: "settings.rolesAndPermissions.type.custom",
|
||||
memberCount: 3,
|
||||
permissionCount: 4,
|
||||
canEdit: true,
|
||||
canDelete: true,
|
||||
deleteBlockedInUse: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
describe("renderRolesListMock (M017)", () => {
|
||||
test("renders normalized rows with capability data-attributes", () => {
|
||||
const html = renderRolesListMock(model);
|
||||
expect(html).toContain('data-ui-impl="mock"');
|
||||
expect(html).toContain('data-ui-id="ui.settings.rolesAndPermissions.roles"');
|
||||
expect(html).toContain('data-row-id="sys"');
|
||||
expect(html).toContain('data-type-key="settings.rolesAndPermissions.type.custom"');
|
||||
expect(html).toContain('data-delete-blocked="true"');
|
||||
expect(html).toContain('data-can-create="true"');
|
||||
});
|
||||
|
||||
test("renders the empty state as an i18n key", () => {
|
||||
const html = renderRolesListMock({ ...model, rows: [], rowCount: 0 });
|
||||
expect(html).toContain('data-empty="true"');
|
||||
expect(html).toContain('data-i18n-key="settings.rolesAndPermissions.empty.title"');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user