WIP: try to fix unit test

This commit is contained in:
Ryan Zhao 2023-08-14 15:31:11 +10:00
parent 432f32b0a8
commit 0df7baa2ee
1 changed files with 14 additions and 9 deletions

View File

@ -107,13 +107,18 @@ class MessageReceiverDisappearingMessagesSpec: QuickSpec {
// MARK: -- updates the local config properly // MARK: -- updates the local config properly
it("updates the local config properly") { it("updates the local config properly") {
mockStorage.write { db in mockStorage.write { db in
try MessageReceiver.updateDisappearingMessagesConfigurationIfNeeded( do {
db, try MessageReceiver.updateDisappearingMessagesConfigurationIfNeeded(
threadId: "TestId", db,
threadVariant: .contact, threadId: "TestId",
message: mockMessage, threadVariant: .contact,
proto: mockProto message: mockMessage,
) proto: mockProto
)
}
catch {
print(error)
}
} }
let updatedConfig: DisappearingMessagesConfiguration? = mockStorage.read { db in let updatedConfig: DisappearingMessagesConfiguration? = mockStorage.read { db in
@ -121,8 +126,8 @@ class MessageReceiverDisappearingMessagesSpec: QuickSpec {
} }
expect(updatedConfig?.isEnabled).to(beTrue()) expect(updatedConfig?.isEnabled).to(beTrue())
// expect(updatedConfig?.durationSeconds) expect(updatedConfig?.durationSeconds)
// .to(equal(DisappearingMessagesConfiguration.DefaultDuration.disappearAfterRead.seconds)) .to(equal(DisappearingMessagesConfiguration.DefaultDuration.disappearAfterRead.seconds))
expect(updatedConfig?.type).to(equal(.disappearAfterRead)) expect(updatedConfig?.type).to(equal(.disappearAfterRead))
} }
} }