Skip to content

Commit 96bb585

Browse files
Copilothotlong
andcommitted
fix: add missing account_merge successMessage, expand compliance tests to 30 covering objects/views/pages
- Add missing successMessage to account_merge action - Expand compliance tests: add objects, views, pages checks for all examples - 30 tests now cover all 7 audit dimensions: objects, views, dashboards, pages, apps/navigation, manifest, actions Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 7a8fe34 commit 96bb585

File tree

2 files changed

+66
-4
lines changed

2 files changed

+66
-4
lines changed

examples/crm/src/actions/account.actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ export const AccountActions = [
3333
confirmText: 'Are you sure you want to merge these accounts? This action cannot be undone.',
3434
variant: 'danger' as const,
3535
refreshAfter: true,
36+
successMessage: 'Accounts merged successfully',
3637
},
3738
];

packages/types/src/__tests__/examples-metadata-compliance.test.ts

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,32 @@ describe('Example: todo', () => {
8282
expectValidStack(config, 'todo');
8383
});
8484

85-
it('dashboards should have type, name, label, description', () => {
85+
it('should have explicit views', () => {
86+
expect(Array.isArray(config.views)).toBe(true);
87+
expect(config.views.length).toBeGreaterThan(0);
88+
});
89+
90+
it('objects should have name, label, and fields', () => {
91+
for (const obj of config.objects) {
92+
expect(obj).toHaveProperty('name');
93+
expect(obj).toHaveProperty('label');
94+
expect(obj).toHaveProperty('fields');
95+
}
96+
});
97+
98+
it('dashboards should have name, label, description, and valid widgets', () => {
8699
assertDashboards(config.dashboards, 'todo');
87100
});
88101

102+
it('pages should have name, label, type, and regions', () => {
103+
for (const page of config.pages ?? []) {
104+
expect(page).toHaveProperty('name');
105+
expect(page).toHaveProperty('label');
106+
expect(page).toHaveProperty('type');
107+
expect(page).toHaveProperty('regions');
108+
}
109+
});
110+
89111
it('manifest should have required fields', () => {
90112
assertManifest(config.manifest);
91113
});
@@ -112,15 +134,32 @@ describe('Example: kitchen-sink', () => {
112134
expectValidStack(config, 'kitchen-sink');
113135
});
114136

115-
it('dashboards should have type, name, label, description', () => {
116-
assertDashboards(config.dashboards, 'kitchen-sink');
137+
it('objects should have name, label, and fields', () => {
138+
for (const obj of config.objects) {
139+
expect(obj).toHaveProperty('name');
140+
expect(obj).toHaveProperty('label');
141+
expect(obj).toHaveProperty('fields');
142+
}
117143
});
118144

119145
it('should have explicit views', () => {
120146
expect(Array.isArray(config.views)).toBe(true);
121147
expect(config.views.length).toBeGreaterThan(0);
122148
});
123149

150+
it('dashboards should have name, label, description, and valid widgets', () => {
151+
assertDashboards(config.dashboards, 'kitchen-sink');
152+
});
153+
154+
it('pages should have name, label, type, and regions', () => {
155+
for (const page of config.pages ?? []) {
156+
expect(page).toHaveProperty('name');
157+
expect(page).toHaveProperty('label');
158+
expect(page).toHaveProperty('type');
159+
expect(page).toHaveProperty('regions');
160+
}
161+
});
162+
124163
it('manifest should have required fields', () => {
125164
assertManifest(config.manifest);
126165
});
@@ -145,10 +184,32 @@ describe('Example: crm', () => {
145184
expectValidStack(config, 'crm');
146185
});
147186

148-
it('dashboards should have type, name, label, description', () => {
187+
it('objects should have name, label, and fields', () => {
188+
for (const obj of config.objects) {
189+
expect(obj).toHaveProperty('name');
190+
expect(obj).toHaveProperty('label');
191+
expect(obj).toHaveProperty('fields');
192+
}
193+
});
194+
195+
it('should have explicit views', () => {
196+
expect(Array.isArray(config.views)).toBe(true);
197+
expect(config.views.length).toBeGreaterThan(0);
198+
});
199+
200+
it('dashboards should have name, label, description, and valid widgets', () => {
149201
assertDashboards(config.dashboards, 'crm');
150202
});
151203

204+
it('pages should have name, label, type, and regions', () => {
205+
for (const page of config.pages ?? []) {
206+
expect(page).toHaveProperty('name');
207+
expect(page).toHaveProperty('label');
208+
expect(page).toHaveProperty('type');
209+
expect(page).toHaveProperty('regions');
210+
}
211+
});
212+
152213
it('manifest should have required fields', () => {
153214
assertManifest(config.manifest);
154215
});

0 commit comments

Comments
 (0)