MCPcopy
hub / github.com/tldraw/tldraw / homeState

Function homeState

packages/dotcom-shared/src/mutators.test.ts:1123–1140  ·  view source on GitHub ↗
(extra?: { secondOwnerId?: string })

Source from the content-addressed store, hash-verified

1121 // The home workspace (group id === userId) can't be invited to, left, deleted,
1122 // or have its members managed. (It can be renamed.)
1123 function homeState(extra?: { secondOwnerId?: string }) {
1124 const group_user: TlaGroupUser[] = [makeGroupUser({ userId, groupId: userId, role: 'owner' })]
1125 const user = [makeUser({ id: userId, flags: 'groups_backend' })]
1126 if (extra?.secondOwnerId) {
1127 group_user.push(
1128 makeGroupUser({ userId: extra.secondOwnerId, groupId: userId, role: 'owner' })
1129 )
1130 user.push(makeUser({ id: extra.secondOwnerId, flags: 'groups_backend' }))
1131 }
1132 return {
1133 user,
1134 file: [],
1135 file_state: [],
1136 group: [makeGroup({ id: userId })],
1137 group_user,
1138 group_file: [],
1139 } satisfies TableStore
1140 }
1141
1142 it('can rename home workspace', async () => {
1143 const { tx } = createMockTx(homeState())

Callers 1

mutators.test.tsFile · 0.85

Calls 4

makeGroupUserFunction · 0.85
makeUserFunction · 0.85
makeGroupFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…