Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: fix tests #48

Open
wants to merge 6 commits into
base: fern-bot/07-04-2024-1109PM
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add additional checks
kainpets committed Jul 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit fa97a3da1c44b77bbb965a18372d424bac77da30
1 change: 1 addition & 0 deletions test/integration/access_codes_test.go
Original file line number Diff line number Diff line change
@@ -128,6 +128,7 @@ func TestAccessCodes(t *testing.T) {
)
require.NoError(t, err)
require.NotNil(t, createdAccessCodes, "Created access codes should not be nil")
assert.Len(t, createdAccessCodes, 1)
assert.NotEmpty(t, createdAccessCodes, "Created access codes should not be empty")
assert.Equal(t, len(deviceIds), len(createdAccessCodes))

27 changes: 27 additions & 0 deletions test/integration/devices_test.go
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@ func TestDevices(t *testing.T) {
require.NoError(t, err)
assert.Len(t, devices, 2)

// query device with id
devices, err = seam.Devices.List(
ctx,
&seamgo.DevicesListRequest{
@@ -76,6 +77,32 @@ func TestDevices(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, device.DisplayName, deviceWithId.DisplayName)

// query device with name
device = getTestDevice(t, seam)
require.NotNil(t, device, "Test device should not be nil")

deviceByName, err := seam.Devices.Get(
ctx,
&seamgo.DevicesGetRequest{
Name: &device.DisplayName,
},
)
require.NoError(t, err)
assert.NotNil(t, deviceByName, "Device queried by name should not be nil")
assert.Equal(t, device.DisplayName, deviceByName.DisplayName)

deviceByNameAndId, err := seam.Devices.Get(
ctx,
&seamgo.DevicesGetRequest{
Name: &device.DisplayName,
DeviceId: &device.DeviceId,
},
)
require.NoError(t, err)
assert.NotNil(t, deviceByNameAndId, "Device queried by name and ID should not be nil")
assert.Equal(t, device.DisplayName, deviceByNameAndId.DisplayName)
assert.Equal(t, device.DeviceId, deviceByNameAndId.DeviceId)

locks, err := seam.Locks.List(
ctx,
nil,