Skip to content

Commit

Permalink
Test sharedListEntry title updates on page title update
Browse files Browse the repository at this point in the history
  • Loading branch information
poltak committed Mar 5, 2024
1 parent 574e195 commit e4db3c1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,15 @@ describe('Personal cloud translation layer', () => {
.createObject(
LOCAL_TEST_DATA_V24.sharedAnnotationMetadata.first,
)
await setups[0].storageManager
.collection('customLists')
.createObject(LOCAL_TEST_DATA_V24.customLists.first)
await setups[0].storageManager
.collection('sharedListMetadata')
.createObject(LOCAL_TEST_DATA_V24.sharedListMetadata.first)
await setups[0].storageManager
.collection('pageListEntries')
.createObject(LOCAL_TEST_DATA_V24.pageListEntries.first)
const updatedTitle = 'Updated title'

const localPage: PipelineRes = await setups[0].storageManager
Expand Down Expand Up @@ -640,6 +649,7 @@ describe('Personal cloud translation layer', () => {

const remoteData = serverIdCapturer.mergeIds(REMOTE_TEST_DATA_V24)
const testMetadata = remoteData.personalContentMetadata
const testListShares = remoteData.personalListShare
const testLocators = remoteData.personalContentLocator

// prettier-ignore
Expand All @@ -651,11 +661,12 @@ describe('Personal cloud translation layer', () => {
'personalContentMetadata',
'personalContentLocator',
'sharedPageInfo',
'sharedListEntry',
], { getWhere: getPersonalWhere }),
).toEqual({
...personalDataChanges(remoteData, [
[DataChangeType.Modify, 'personalContentMetadata', testMetadata.first.id],
], { skipChanges: 7 }),
], { skipChanges: 10 }),
personalBlockStats: [personalBlockStats({ usedBlocks: 3 })],
personalContentMetadata: [
{
Expand All @@ -674,16 +685,26 @@ describe('Personal cloud translation layer', () => {
updatedWhen: expect.anything(),
createdWhen: expect.anything(),
}],
sharedListEntry: [{
id: expect.anything(),
creator: TEST_USER.id,
entryTitle: updatedTitle,
sharedList: testListShares.first.remoteId,
normalizedUrl: testLocators.first.location,
originalUrl: testLocators.first.originalLocation,
createdWhen: expect.anything(),
updatedWhen: expect.anything(),
}],
})
// prettier-ignore
await testDownload([
{
type: PersonalCloudUpdateType.Overwrite, collection: 'pages', object: {
...LOCAL_TEST_DATA_V24.pages.first,
fullTitle: updatedTitle
}
},
},
], { skip: 4 })
], { skip: 7 })
testSyncPushTrigger({ wasTriggered: true })
})

Expand Down

0 comments on commit e4db3c1

Please sign in to comment.