You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/js/utils/__tests__/device.test.js

57 lines
1.4 KiB

import * as dUtils from 'utils/device';
describe('device utils', () => {
it('get status', () => {
const deviceMock = [
{
device: {
connected: false,
type: 'acquired',
status: 'occupied',
},
},
{ device: { connected: true } },
{ device: { available: false } },
{ device: { available: true } },
];
deviceMock.forEach((device) => {
expect(dUtils.getStatusName(device)).toMatchSnapshot();
});
});
it('get status color', () => {
const entry = [
0,
null,
'sdsdsdsd',
'used-in-other-window',
'connected',
'unacquired',
'disconnected',
'unavailable',
];
entry.forEach((status) => {
expect(dUtils.getStatusColor(status)).toMatchSnapshot();
});
});
it('get status name', () => {
const entry = [
0,
null,
'sdsdsdsd',
'used-in-other-window',
'connected',
'unacquired',
'disconnected',
'unavailable',
];
entry.forEach((status) => {
expect(dUtils.getStatusName(status)).toMatchSnapshot();
});
});
});