|
1 | 1 | import { describe, expect, it } from 'vitest' |
2 | 2 | import { createTestContext } from '../../_test/setup.helper' |
3 | 3 | import { asDm, setupMultiPlayerContext } from '../../_test/identities.helper' |
4 | | -import { createBlock, createNote, createSidebarShare } from '../../_test/factories.helper' |
| 4 | +import { |
| 5 | + createBlock, |
| 6 | + createNote, |
| 7 | + createSidebarShare, |
| 8 | + testBlock, |
| 9 | +} from '../../_test/factories.helper' |
5 | 10 | import { api } from '../../_generated/api' |
6 | 11 |
|
7 | 12 | describe('block sharing workflows', () => { |
@@ -31,16 +36,8 @@ describe('block sharing workflows', () => { |
31 | 36 | campaignMemberId: p2.memberId, |
32 | 37 | }) |
33 | 38 |
|
34 | | - const blockContent1 = { |
35 | | - id: block1.blockId, |
36 | | - type: 'paragraph' as const, |
37 | | - content: [], |
38 | | - } |
39 | | - const blockContent2 = { |
40 | | - id: block2.blockId, |
41 | | - type: 'paragraph' as const, |
42 | | - content: [], |
43 | | - } |
| 39 | + const blockContent1 = testBlock(block1.blockId) |
| 40 | + const blockContent2 = testBlock(block2.blockId) |
44 | 41 |
|
45 | 42 | await dmAuth.mutation(api.blockShares.mutations.setBlocksShareStatus, { |
46 | 43 | campaignId: ctx.campaignId, |
@@ -131,11 +128,7 @@ describe('block sharing workflows', () => { |
131 | 128 | campaignMemberId: p1.memberId, |
132 | 129 | }) |
133 | 130 |
|
134 | | - const blockContent = { |
135 | | - id: block.blockId, |
136 | | - type: 'paragraph' as const, |
137 | | - content: [], |
138 | | - } |
| 131 | + const blockContent = testBlock(block.blockId) |
139 | 132 |
|
140 | 133 | await dmAuth.mutation(api.blockShares.mutations.setBlocksShareStatus, { |
141 | 134 | campaignId: ctx.campaignId, |
@@ -248,11 +241,7 @@ describe('block sharing workflows', () => { |
248 | 241 | campaignMemberId: p1.memberId, |
249 | 242 | }) |
250 | 243 |
|
251 | | - const blockContent = { |
252 | | - id: block.blockId, |
253 | | - type: 'paragraph' as const, |
254 | | - content: [], |
255 | | - } |
| 244 | + const blockContent = testBlock(block.blockId) |
256 | 245 |
|
257 | 246 | await dmAuth.mutation(api.blockShares.mutations.setBlocksShareStatus, { |
258 | 247 | campaignId: ctx.campaignId, |
@@ -308,11 +297,7 @@ describe('block sharing workflows', () => { |
308 | 297 | const note = await createNote(t, ctx.campaignId, ctx.dm.profile._id) |
309 | 298 | const block = await createBlock(t, note.noteId, ctx.campaignId, ctx.dm.profile._id) |
310 | 299 |
|
311 | | - const blockContent = { |
312 | | - id: block.blockId, |
313 | | - type: 'paragraph' as const, |
314 | | - content: [], |
315 | | - } |
| 300 | + const blockContent = testBlock(block.blockId) |
316 | 301 |
|
317 | 302 | await dmAuth.mutation(api.blockShares.mutations.setBlocksShareStatus, { |
318 | 303 | campaignId: ctx.campaignId, |
|
0 commit comments