Skip to content

Commit

Permalink
revert commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
kainpets committed Jul 5, 2024
1 parent a4db80d commit 80ecf83
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions test/integration/access_codes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,12 @@ func TestAccessCodes(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, deleteResponse, "Delete response should not be nil")
require.NotNil(t, deleteResponse.ActionAttempt, "Action attempt should not be nil")
require.NotNil(t, deleteResponse.ActionAttempt.ActionAttemptActionAttemptId, "Action attempt ID should not be nil")
assert.NotNil(t, deleteResponse.ActionAttempt.ActionAttemptActionAttemptId.Result)

deviceIds := make([]string, 0, len(accessCodes))
for _, accessCode := range accessCodes {
deviceIds = append(deviceIds, accessCode.DeviceId)
}

// Add a check to ensure deviceIds is not empty
require.NotEmpty(t, deviceIds, "Device IDs slice should not be empty")

createdAccessCodes, err := seam.AccessCodes.CreateMultiple(
Expand All @@ -142,4 +139,37 @@ func TestAccessCodes(t *testing.T) {
}
}
assert.Len(t, commonCodes, 1)


// Fake Seam does not dedupe access codes.
// _, err = seam.AccessCodes.Create(
// ctx,
// &seamgo.AccessCodesCreateRequest{
// DeviceId: device.DeviceId,
// Name: seamgo.String("Duplicate Access Code"),
// Code: seamgo.String("4444"),
// },
// )
// require.Error(t, err)

// Fake Seam does not like access code update.
// _, err = seam.AccessCodes.Update(
// ctx,
// &seamgo.AccessCodesUpdateRequest{
// AccessCodeId: createdAccessCode.AccessCodeId,
// Type: seamgo.AccessCodesUpdateRequestTypeTimeBound.Ptr(),
// StartsAt: seamgo.String("3001-01-01"),
// EndsAt: seamgo.String("3001-01-03"),
// },
// )
// require.NoError(t, err)

// accessCode, err := seam.AccessCodes.Get(
// ctx,
// &seamgo.AccessCodesGetRequest{
// AccessCodeId: &createdAccessCode.AccessCodeId,
// },
// )
// require.NoError(t, err)
// assert.Equal(t, seamgo.AccessCodeTypeTimeBound, accessCode.Type)
}

0 comments on commit 80ecf83

Please sign in to comment.