fix TestLists_PostList test

This commit is contained in:
hiteshrepo 2024-01-11 00:00:07 +05:30
parent e3925732a7
commit fcdcafbb2e
2 changed files with 6 additions and 1 deletions

View File

@ -243,6 +243,11 @@ func IsErrItemAlreadyExistsConflict(err error) bool {
parseODataErr(err).hasErrorCode(err, nameAlreadyExists) parseODataErr(err).hasErrorCode(err, nameAlreadyExists)
} }
func IsErrNameAlreadyExistsConflict(err error) bool {
return errors.Is(err, ErrNameAlreadyExistsConflict) ||
parseODataErr(err).hasErrorCode(err, nameAlreadyExists)
}
// LabelStatus transforms the provided statusCode into // LabelStatus transforms the provided statusCode into
// a standard label that can be attached to a clues error // a standard label that can be attached to a clues error
// and later reviewed when checking error statuses. // and later reviewed when checking error statuses.

View File

@ -758,7 +758,7 @@ func (suite *ListsAPIIntgSuite) TestLists_PostList() {
_, err = acl.PostList(ctx, siteID, listName, oldListByteArray, fault.New(true)) _, err = acl.PostList(ctx, siteID, listName, oldListByteArray, fault.New(true))
require.Error(t, err) require.Error(t, err)
assert.Equal(t, graph.ErrNameAlreadyExistsConflict, err) assert.True(t, graph.IsErrNameAlreadyExistsConflict(err))
newListItems := newList.GetItems() newListItems := newList.GetItems()
require.Less(t, 0, len(newListItems)) require.Less(t, 0, len(newListItems))