Skip to content

Commit

Permalink
update zemu tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ftheirs committed Jul 23, 2024
1 parent 1c6b62e commit 2f19738
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
},
"dependencies": {
"@zondax/ledger-cosmos-js": "^3.0.3",
"@zondax/zemu": "^0.50.1"
"@zondax/zemu": "^0.50.2"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/ledgerhq__hw-transport": "^4.21.8",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"bech32": "^2.0.0",
"blakejs": "^1.1.1",
"crypto-js": "4.2.0",
Expand All @@ -43,6 +43,6 @@
"secp256k1": "^5.0.0",
"ts-jest": "^29.2.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.3"
"typescript": "^5.5.4"
}
}
16 changes: 8 additions & 8 deletions tests_zemu/tests/standard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ describe('Standard', function () {
await sim.start({
...defaultOptions,
model: m.name,
approveKeyword: isTouchDevice(m.name) ? 'QR' : '',
approveAction: ButtonKind.ApproveTapButton,
approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '',
approveAction: ButtonKind.DynamicTapButton,
})
const app = new CosmosApp(sim.getTransport())

Expand Down Expand Up @@ -131,8 +131,8 @@ describe('Standard', function () {
await sim.start({
...defaultOptions,
model: m.name,
approveKeyword: isTouchDevice(m.name) ? 'Path' : '',
approveAction: ButtonKind.ApproveTapButton,
approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '',
approveAction: ButtonKind.DynamicTapButton,
})
const app = new CosmosApp(sim.getTransport())

Expand Down Expand Up @@ -184,8 +184,8 @@ describe('Standard', function () {
await sim.start({
...defaultOptions,
model: m.name,
approveKeyword: isTouchDevice(m.name) ? 'QR' : '',
approveAction: ButtonKind.ApproveTapButton,
approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '',
approveAction: ButtonKind.DynamicTapButton,
})
const app = new CosmosApp(sim.getTransport())

Expand All @@ -207,8 +207,8 @@ describe('Standard', function () {
await sim.start({
...defaultOptions,
model: m.name,
approveKeyword: isTouchDevice(m.name) ? 'Path' : '',
approveAction: ButtonKind.ApproveTapButton,
approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '',
approveAction: ButtonKind.DynamicTapButton,
})
const app = new CosmosApp(sim.getTransport())

Expand Down
15 changes: 9 additions & 6 deletions tests_zemu/tests/textual.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ import { ButtonKind, IButton, SwipeDirection } from '@zondax/zemu/dist/types'

jest.setTimeout(90000)

// Textual mode is not available for NanoS
const TEXTUAL_MODELS = DEVICE_MODELS.filter(m => m.name !== 'nanos')

describe('Textual', function () {
// eslint-disable-next-line jest/expect-expect
test.concurrent.each(DEVICE_MODELS.slice(1))('can start and stop container', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('can start and stop container', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand All @@ -37,7 +40,7 @@ describe('Textual', function () {
}
})

test.concurrent.each(DEVICE_MODELS.slice(1))('sign basic textual', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('sign basic textual', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand Down Expand Up @@ -83,7 +86,7 @@ describe('Textual', function () {
}
})

test.concurrent.each(DEVICE_MODELS.slice(1))('sign basic textual expert', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('sign basic textual expert', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand Down Expand Up @@ -132,7 +135,7 @@ describe('Textual', function () {
}
})

test.concurrent.each(DEVICE_MODELS.slice(1))('sign basic textual eth ', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('sign basic textual eth ', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand Down Expand Up @@ -181,7 +184,7 @@ describe('Textual', function () {
}
})

test.concurrent.each(DEVICE_MODELS.slice(1))('sign basic textual eth warning ', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('sign basic textual eth warning ', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand Down Expand Up @@ -228,7 +231,7 @@ describe('Textual', function () {
}
})

test.concurrent.each(DEVICE_MODELS.slice(1))('sign basic textual evmos ', async function (m) {
test.concurrent.each(TEXTUAL_MODELS)('sign basic textual evmos ', async function (m) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
Expand Down

0 comments on commit 2f19738

Please sign in to comment.