Skip to content

Commit 80a1dae

Browse files
committed
test(app-shell): the 26858 matrix fake answers withPreviewDrafts, as the package door now reads through it
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbYiz7aUf8wSAnnRyMx
1 parent 59d89d6 commit 80a1dae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.serverVerdict-26858.test.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function verdictOf(body: Record<string, unknown>) {
4646
return errors.length ? { valid: false, errors } : { valid: true };
4747
}
4848

49-
type FakeClient = Record<string, (...args: never[]) => Promise<unknown>>;
49+
// `withPreviewDrafts` answers the client itself, not a promise (objectstack#26840).
50+
type FakeClient = Record<string, (...args: never[]) => unknown>;
5051

5152
function makeClient(server: Server): FakeClient {
5253
return {
@@ -57,6 +58,8 @@ function makeClient(server: Server): FakeClient {
5758
? { type: 'permission', name: 'sales_perms', item: { ...server.draft, _draft: true, _diagnostics: verdictOf(server.draft) } }
5859
: null;
5960
},
61+
// objectstack#26840 — the package door reads its objects through the draft-overlaid door.
62+
withPreviewDrafts() { return this; },
6063
list: async (type: string) => (type === 'object' ? [{ item: { name: 'a_account' } }] : []),
6164
get: async () => null,
6265
save: async (_type: string, _name: string, payload: Record<string, unknown>) => {

0 commit comments

Comments
 (0)