mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-25 19:23:40 +00:00
Device manager - label devices as inactive (PSG-638) (#9175)
* filter devices by security recommendation * display inactive status on device tile * unify DeviceSecurityVariation type, add correct icon to inactive ui * tidy * avoid dead code warning
This commit is contained in:
@@ -109,5 +109,18 @@ describe('<DeviceTile />', () => {
|
||||
const { getByTestId } = render(getComponent({ device }));
|
||||
expect(getByTestId('device-metadata-lastActivity').textContent).toEqual('Last activity Dec 29, 2021');
|
||||
});
|
||||
|
||||
it('renders with inactive notice when last activity was more than 90 days ago', () => {
|
||||
const device: IMyDevice = {
|
||||
device_id: '123',
|
||||
last_seen_ip: '1.2.3.4',
|
||||
last_seen_ts: now - (MS_DAY * 100),
|
||||
};
|
||||
const { getByTestId, queryByTestId } = render(getComponent({ device }));
|
||||
expect(getByTestId('device-metadata-inactive').textContent).toEqual('Inactive for 90+ days (Dec 4, 2021)');
|
||||
// last activity and verification not shown when inactive
|
||||
expect(queryByTestId('device-metadata-lastActivity')).toBeFalsy();
|
||||
expect(queryByTestId('device-metadata-verificationStatus')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user