@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
37 lines • 2.05 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = __importDefault(require("."));
const deviceInfos_1 = require("../__tests__/test-helpers/deviceInfos");
test("firmwareUpdateNeedsLegacyBlueResetInstructions", () => {
(0, deviceInfos_1.lenseDevices)(["Blue211", "NanoS120", "NanoS142", "NanoS155", "NanoX1242rc5"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUpdateNeedsLegacyBlueResetInstructions(deviceInfo, modelId)).toBe(false);
});
});
test("firmwareUpdateWillUninstallApps", () => {
(0, deviceInfos_1.lenseDevices)(["Blue211", "NanoS120", "NanoS142", "NanoS155", "NanoX1242rc5"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUpdateWillUninstallApps(deviceInfo, modelId)).toBe(true);
});
});
test("firmwareUpdateRequiresUserToUninstallApps", () => {
(0, deviceInfos_1.lenseDevices)(["Blue211", "NanoS155", "NanoX1242rc5"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUpdateRequiresUserToUninstallApps(modelId, deviceInfo)).toBe(false);
});
(0, deviceInfos_1.lenseDevices)(["NanoS120", "NanoS142"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUpdateRequiresUserToUninstallApps(modelId, deviceInfo)).toBe(true);
});
});
test("firmwareUnsupported", () => {
(0, deviceInfos_1.lenseDevices)(["Blue211", "NanoS142", "NanoS155", "NanoX1242rc5"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUnsupported(modelId, deviceInfo)).toBe(false);
});
(0, deviceInfos_1.lenseDevices)(["NanoS120"]).forEach(({ deviceInfo, modelId }) => {
expect(_1.default.firmwareUnsupported(modelId, deviceInfo)).toBe(true);
});
});
test("A terminated currency is still installable", () => {
expect(_1.default.canHandleInstall({ name: "Stratis" })).toBe(true);
});
//# sourceMappingURL=index.test.js.map