1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-25 16:38:08 +00:00

Added missing device tests

This commit is contained in:
Vladimir Volek 2018-09-12 12:05:14 +02:00
parent 2e5d12428b
commit 84b218ecaa
2 changed files with 33 additions and 0 deletions

View File

@ -55,3 +55,13 @@ exports[`device utils get version 4`] = `"1"`;
exports[`device utils get version 5`] = `"1"`;
exports[`device utils get version 6`] = `"T"`;
exports[`device utils isDisabled 1`] = `false`;
exports[`device utils isDisabled 2`] = `true`;
exports[`device utils isWebUSB 1`] = `true`;
exports[`device utils isWebUSB 2`] = `false`;
exports[`device utils isWebUSB 3`] = `true`;

View File

@ -38,6 +38,29 @@ describe('device utils', () => {
});
});
it('isWebUSB', () => {
const data = [
{ transport: { version: ['webusb'] } },
{ transport: { version: ['aaaaaa'] } },
{ transport: { version: ['webusb', 'test'] } },
];
data.forEach((item) => {
expect(dUtils.isWebUSB(item.transport)).toMatchSnapshot();
});
});
it('isDisabled', () => {
const data = [
{ selectedDevice: { features: null }, devices: [1, 2, 3], transport: { version: ['webusb', 'test'] } },
{ selectedDevice: { features: null }, devices: [], transport: { version: ['test'] } },
];
data.forEach((item) => {
expect(dUtils.isDisabled(item.selectedDevice, item.devices, item.transport)).toMatchSnapshot();
});
});
it('get version', () => {
const deviceMock = [
{ },