WIP: try to fix unit test

This commit is contained in:
Ryan Zhao 2023-08-14 15:23:11 +10:00
parent c4afcb3c3e
commit 432f32b0a8
1 changed files with 8 additions and 13 deletions

View File

@ -107,18 +107,13 @@ 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
do { try MessageReceiver.updateDisappearingMessagesConfigurationIfNeeded(
try MessageReceiver.updateDisappearingMessagesConfigurationIfNeeded( db,
db, threadId: "TestId",
threadId: "TestId", threadVariant: .contact,
threadVariant: .contact, message: mockMessage,
message: mockMessage, proto: mockProto
proto: mockProto )
)
}
catch {
print(error)
}
} }
let updatedConfig: DisappearingMessagesConfiguration? = mockStorage.read { db in let updatedConfig: DisappearingMessagesConfiguration? = mockStorage.read { db in
@ -128,7 +123,7 @@ 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))
} }
} }
} }