Files
speckle-server/packages/server/test/speckle-helpers/workspaces.ts
T
Chuck Driesler 969ca64a1b feat(workspaces): toggle embedded viewer branding (#4762)
* feat(viewer): embedded viewer option to hide speckle branding

* chore(viewer): can edit embed options policy

* chore(embeds): tests for new policy and gql
2025-05-19 13:19:38 +01:00

26 lines
898 B
TypeScript

import { UpsertWorkspace } from '@/modules/workspaces/domain/operations'
import { Workspace } from '@/modules/workspacesCore/domain/types'
import cryptoRandomString from 'crypto-random-string'
export const createAndStoreTestWorkspaceFactory =
({ upsertWorkspace }: { upsertWorkspace: UpsertWorkspace }) =>
async (workspaceOverrides: Partial<Workspace> = {}) => {
const workspace: Omit<Workspace, 'domains'> = {
id: cryptoRandomString({ length: 10 }),
slug: cryptoRandomString({ length: 10 }),
name: cryptoRandomString({ length: 10 }),
createdAt: new Date(),
updatedAt: new Date(),
description: null,
logo: null,
domainBasedMembershipProtectionEnabled: false,
discoverabilityEnabled: false,
isEmbedSpeckleBrandingHidden: false,
...workspaceOverrides
}
await upsertWorkspace({ workspace })
return workspace
}