From c3edae6280a6a898d6644d9b172a7a3bdcf10202 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 9 Feb 2020 22:16:23 +0100 Subject: [PATCH] test tweaks --- tests/__mocks__/electron.js | 23 +++++++++++++++++++++++ tests/pages/index.test.jsx | 1 + 2 files changed, 24 insertions(+) create mode 100644 tests/__mocks__/electron.js diff --git a/tests/__mocks__/electron.js b/tests/__mocks__/electron.js new file mode 100644 index 0000000..4fc48bc --- /dev/null +++ b/tests/__mocks__/electron.js @@ -0,0 +1,23 @@ +const electron = { + require: jest.fn(), + match: jest.fn(), + app: jest.fn(), + remote: jest.fn(), + shell: jest.fn(), + dialog: jest.fn() +} + +const remote = { + getCurrentWindow: jest.fn() +} + +// for the shell module above +const shell = { + openExternal: jest.fn() +} + +module.exports = { + electron, + remote, + shell +} diff --git a/tests/pages/index.test.jsx b/tests/pages/index.test.jsx index 5a79b3b..9089090 100644 --- a/tests/pages/index.test.jsx +++ b/tests/pages/index.test.jsx @@ -13,6 +13,7 @@ describe('Home', () => { ) expect(container.firstChild).toBeInTheDocument() fireEvent.click(getByText(/Ξ/)) + // fireEvent.click(getByText(/0x/)) }) it('renders Welcome without config', () => {