Skip to content

Commit

Permalink
mock invest list for changelog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Dec 13, 2024
1 parent 251b4de commit 7474a60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions workbench/tests/renderer/changelog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import userEvent from '@testing-library/user-event';

import App from '../../src/renderer/app';
import pkg from '../../package.json';
import { getInvestModelNames } from '../../src/renderer/server_requests';

jest.mock('../../src/renderer/server_requests');

const MOCK_MODEL_TITLE = 'Carbon';
const MOCK_MODEL_RUN_NAME = 'carbon';
const MOCK_INVEST_LIST = {
[MOCK_MODEL_TITLE]: {
model_name: MOCK_MODEL_RUN_NAME,
},
};

describe('Changelog', () => {
const currentVersion = pkg.version;
Expand All @@ -27,6 +38,7 @@ describe('Changelog', () => {
</html>
`
});
getInvestModelNames.mockResolvedValue(MOCK_INVEST_LIST);
});

test('Changelog modal opens immediately on launch of a new version', async () => {
Expand Down

0 comments on commit 7474a60

Please sign in to comment.