`isDeleted` is false after calling `delete` on a model using SoftDeletes
Closed this issue · 1 comments
mr-feek commented
Steps to reproduce:
- create a model that uses the soft deletes mixin
- a test case with the following:
const user = await UserFactory.create();
await user.delete();
assert.isTrue(!!user.deletedAt);
assert.isTrue(user.$isDeleted);
Expected Output:
- test passes
Actual Output:
Assertion Error: expected false to be true
on theassert.isTrue(user.$isDeleted);
line.
Is there another expected way to check if a model is "soft deleted", or would you consider this a bug? Considering that this package replaces delete
functionality entirely, I would personally expect $isDeleted
to be true.
mr-feek commented
Silly me, i should have reread the documentation. There is a trashed
property to reference