Skip to content

Commit

Permalink
Fixed code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
efreeti committed Sep 23, 2020
1 parent 3a4730f commit 7d5d26c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ const createStoreSetup = (trustedAppsService: TrustedAppsService) => {
};
};

beforeEach(() => {
dateNowMock.mockReturnValue(initialNow);
});

describe('middleware', () => {
beforeEach(() => {
dateNowMock.mockReturnValue(initialNow);
});

describe('initial state', () => {
it('sets initial state properly', async () => {
expect(createStoreSetup(createTrustedAppsServiceMock()).store.getState()).toStrictEqual(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({
htmlIdGenerator: () => () => 'mockId',
}));

window.scrollTo = () => {};

describe('TrustedAppsPage', () => {
let history: AppContextTestRender['history'];
let coreStart: AppContextTestRender['coreStart'];
let waitForAction: MiddlewareActionSpyHelper['waitForAction'];
let render: () => ReturnType<AppContextTestRender['render']>;
const originalScrollTo = window.scrollTo;

beforeAll(() => {
window.scrollTo = () => {};
});

afterAll(() => {
window.scrollTo = originalScrollTo;
});

beforeEach(() => {
const mockedContext = createAppRootMockRenderer();
Expand Down

0 comments on commit 7d5d26c

Please sign in to comment.