WIP: try to fix unit test
This commit is contained in:
parent
432f32b0a8
commit
0df7baa2ee
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue