-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(THEEDGE-3739): Fix filter and link to device details (#2112)
Fixes https://issues.redhat.com/browse/THEEDGE-3739. This PR fixes the filter and link on immutable tab for group details.
- Loading branch information
1 parent
64c5f6c
commit 5871f3a
Showing
3 changed files
with
116 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { edgeImageDataResult, mapDefaultData } from './edge'; | ||
|
||
import { mock } from './../__mocks__/systemIssues'; | ||
|
||
describe('mapDefaultData', () => { | ||
it('should return ids', () => { | ||
const result = [{ id: 'd20a' }, { id: 'c14b' }]; | ||
const data = mapDefaultData(result); | ||
expect(data).toBeDefined(); | ||
expect(data).toEqual({ mapDeviceIds: ['d20a', 'c14b'] }); | ||
}); | ||
}); | ||
|
||
describe('edgeImageDataResult', () => { | ||
const mockedData = { | ||
count: 1, | ||
data: { | ||
total: 1, | ||
devices: [ | ||
{ | ||
DeviceID: 1, | ||
DeviceName: 'test', | ||
DeviceUUID: 'd20a', | ||
ImageID: 1, | ||
ImageName: 'test-93', | ||
LastSeen: '2023-12-12T00:10:49.042474Z', | ||
UpdateAvailable: true, | ||
Status: 'RUNNING', | ||
ImageSetID: 1, | ||
DeviceGroups: null, | ||
DispatcherStatus: 'SUCCESS', | ||
DispatcherReason: '', | ||
GroupName: 'test', | ||
GroupUUID: 'test', | ||
}, | ||
], | ||
enforce_edge_groups: false, | ||
}, | ||
}; | ||
const mapIds = ['d20a']; | ||
mock.onPost('/api/edge/v1/devices/devicesview').reply(200, mockedData); | ||
|
||
it('should return imge information', async () => { | ||
const data = await edgeImageDataResult(mapIds); | ||
expect(data).toBeDefined(); | ||
expect(data).toEqual(mockedData); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters