Skip to content

Commit

Permalink
update integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikelee committed Oct 2, 2024
1 parent 5c7f752 commit 92b21f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions server/service/integration_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8327,8 +8327,8 @@ func (s *integrationTestSuite) TestGetHostBatteries() {
require.NoError(t, err)

bats := []*fleet.HostBattery{
{HostID: host.ID, SerialNumber: "a", CycleCount: 1, Health: "Good"},
{HostID: host.ID, SerialNumber: "b", CycleCount: 1002, Health: "Poor"},
{HostID: host.ID, SerialNumber: "a", CycleCount: 1, Health: "Normal"},
{HostID: host.ID, SerialNumber: "b", CycleCount: 1002, Health: "Service recommended"},
}
require.NoError(t, s.ds.ReplaceHostBatteries(context.Background(), host.ID, bats))

Expand All @@ -8338,7 +8338,7 @@ func (s *integrationTestSuite) TestGetHostBatteries() {
// only cycle count and health are returned
require.ElementsMatch(t, []*fleet.HostBattery{
{CycleCount: 1, Health: "Normal"},
{CycleCount: 1002, Health: "Replacement recommended"},
{CycleCount: 1002, Health: "Service recommended"},
}, *getHostResp.Host.Batteries)

// same for get host by identifier
Expand All @@ -8347,7 +8347,7 @@ func (s *integrationTestSuite) TestGetHostBatteries() {
// only cycle count and health are returned
require.ElementsMatch(t, []*fleet.HostBattery{
{CycleCount: 1, Health: "Normal"},
{CycleCount: 1002, Health: "Replacement recommended"},
{CycleCount: 1002, Health: "Service recommended"},
}, *getHostResp.Host.Batteries)
}

Expand Down
2 changes: 1 addition & 1 deletion server/service/integration_desktop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (s *integrationTestSuite) TestDeviceAuthenticatedEndpoints() {
require.NoError(t, s.ds.SetOrUpdateMunkiInfo(context.Background(), hosts[0].ID, "1.3.0", nil, nil))
// create a battery for hosts[0]
require.NoError(t, s.ds.ReplaceHostBatteries(context.Background(), hosts[0].ID, []*fleet.HostBattery{
{HostID: hosts[0].ID, SerialNumber: "a", CycleCount: 1, Health: "Good"},
{HostID: hosts[0].ID, SerialNumber: "a", CycleCount: 1, Health: "Normal"},
}))

// create an auth token for hosts[0]
Expand Down

0 comments on commit 92b21f3

Please sign in to comment.