WIP: try to fix unit test

pull/941/head
Ryan Zhao 11 months ago
parent 432f32b0a8
commit 0df7baa2ee

@ -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))
}
}

Loading…
Cancel
Save