Fix story backups mock test & read-receipt setting restoration
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
parent
12032b839a
commit
a04e0a4616
4 changed files with 15 additions and 4 deletions
|
@ -617,10 +617,14 @@ export class BackupImportStream extends Writable {
|
|||
'hasStoriesDisabled',
|
||||
accountSettings?.storiesDisabled === true
|
||||
);
|
||||
|
||||
// an undefined value for storyViewReceiptsEnabled is semantically different from
|
||||
// false: it causes us to fallback to `read-receipt-setting`
|
||||
await storage.put(
|
||||
'storyViewReceiptsEnabled',
|
||||
accountSettings?.storyViewReceiptsEnabled === true
|
||||
accountSettings?.storyViewReceiptsEnabled ?? undefined
|
||||
);
|
||||
|
||||
await storage.put(
|
||||
'hasCompletedUsernameOnboarding',
|
||||
accountSettings?.hasCompletedUsernameOnboarding === true
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import createDebug from 'debug';
|
||||
import Long from 'long';
|
||||
import { Proto, StorageState } from '@signalapp/mock-server';
|
||||
import { expect } from 'playwright/test';
|
||||
|
||||
import { generateStoryDistributionId } from '../../types/StoryDistributionId';
|
||||
import { MY_STORY_ID } from '../../types/Stories';
|
||||
|
@ -224,6 +225,9 @@ describe('backups', function (this: Mocha.Suite) {
|
|||
debug('Opening story privacy');
|
||||
await window.locator('.StoriesTab__MoreActionsIcon').click();
|
||||
await window.getByRole('button', { name: 'Story Privacy' }).click();
|
||||
await expect(
|
||||
window.locator('.StoriesSettingsModal__overlay')
|
||||
).toHaveCSS('opacity', '1');
|
||||
|
||||
await snapshot('story privacy');
|
||||
},
|
||||
|
|
|
@ -481,7 +481,10 @@ export class Bootstrap {
|
|||
const window = await app.getWindow();
|
||||
await callback(window, async (name: string) => {
|
||||
debug('creating screenshot');
|
||||
snapshots.push({ name, data: await window.screenshot() });
|
||||
snapshots.push({
|
||||
name,
|
||||
data: await window.screenshot(),
|
||||
});
|
||||
});
|
||||
|
||||
let index = 0;
|
||||
|
@ -512,7 +515,7 @@ export class Bootstrap {
|
|||
{}
|
||||
);
|
||||
|
||||
if (numPixels === 0) {
|
||||
if (numPixels === 0 && !process.env.FORCE_ARTIFACT_SAVE) {
|
||||
debug('no screenshot difference');
|
||||
return;
|
||||
}
|
||||
|
|
2
ts/types/Storage.d.ts
vendored
2
ts/types/Storage.d.ts
vendored
|
@ -80,7 +80,7 @@ export type StorageAccessType = {
|
|||
hasSeenGroupStoryEducationSheet: boolean;
|
||||
hasViewedOnboardingStory: boolean;
|
||||
hasStoriesDisabled: boolean;
|
||||
storyViewReceiptsEnabled: boolean;
|
||||
storyViewReceiptsEnabled: boolean | undefined;
|
||||
identityKeyMap: IdentityKeyMap;
|
||||
lastAttemptedToRefreshProfilesAt: number;
|
||||
lastResortKeyUpdateTime: number;
|
||||
|
|
Loading…
Reference in a new issue