mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-29 23:48:52 +00:00
chore(domain): Assert errors using ErrorIS for instance and organization tests (#11789)
# Which Problems Are Solved This is a small refactoring for tests in `backend/v3/domain` package to use `assert.ErrorIs` instead of `assert.Equal` for error assertion. # How the Problems Are Solved - Add custom `Is()` function to `MultipleObjectsUpdatedError` error - Substitute `assert.Equal` with `assert.ErrorIs` in instance and organization tests # Additional Context This was part of #11035
This commit is contained in:
@@ -86,7 +86,7 @@ func TestDeleteInstanceCommand_Validate(t *testing.T) {
|
||||
err := d.Validate(context.Background(), cmdOpts)
|
||||
|
||||
// Verify
|
||||
assert.Equal(t, tc.expectedError, err)
|
||||
assert.ErrorIs(t, err, tc.expectedError)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ func TestDeleteInstanceCommand_Execute(t *testing.T) {
|
||||
err := d.Execute(ctx, opts)
|
||||
|
||||
// Verify
|
||||
assert.Equal(t, tc.expectedError, err)
|
||||
assert.ErrorIs(t, err, tc.expectedError)
|
||||
assert.Equal(t, tc.expectedInstanceName, d.InstanceName)
|
||||
assert.ElementsMatch(t, tc.expectedInstanceDomains, d.InstanceDomains)
|
||||
assert.Equal(t, tc.expectsDeleteTime, d.DeleteTime != nil && !d.DeleteTime.IsZero())
|
||||
|
||||
Reference in New Issue
Block a user