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