* refactor(Notification): use instance methods * refactor(Audio): move to lib layer * refactor(EncryptionService): rename instance to encryption * refactor(ConnectionTest): move to lib * refactor(FileTransfer): move to lib * refactor(PeerRoom): move to lib * refactor(sleep): move to lib * refactor(type-guards): move to lib * refactor(SerializationService): use standard instance name * refactor(SettingsService): use standard instance name
25 lines
759 B
TypeScript
25 lines
759 B
TypeScript
import { SettingsContextProps } from 'contexts/SettingsContext'
|
|
import { ColorMode, UserSettings } from 'models/settings'
|
|
import { encryption } from 'services/Encryption'
|
|
|
|
export const userSettingsContextStubFactory = (
|
|
userSettingsOverrides: Partial<UserSettings> = {}
|
|
) => {
|
|
const userSettingsStub: SettingsContextProps = {
|
|
updateUserSettings: () => Promise.resolve(),
|
|
getUserSettings: () => ({
|
|
userId: '',
|
|
customUsername: '',
|
|
colorMode: ColorMode.DARK,
|
|
playSoundOnNewMessage: true,
|
|
showNotificationOnNewMessage: true,
|
|
showActiveTypingStatus: true,
|
|
publicKey: encryption.cryptoKeyStub,
|
|
privateKey: encryption.cryptoKeyStub,
|
|
...userSettingsOverrides,
|
|
}),
|
|
}
|
|
|
|
return userSettingsStub
|
|
}
|