[App Search] 100% code coverage plus fix console error (#101407)
This commit is contained in:
parent
9a275de0f9
commit
77533da2be
|
@ -15,6 +15,7 @@ export const mockFlashMessagesActions = {
|
||||||
clearFlashMessages: jest.fn(),
|
clearFlashMessages: jest.fn(),
|
||||||
setQueuedMessages: jest.fn(),
|
setQueuedMessages: jest.fn(),
|
||||||
clearQueuedMessages: jest.fn(),
|
clearQueuedMessages: jest.fn(),
|
||||||
|
dismissToastMessage: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mockFlashMessageHelpers = {
|
export const mockFlashMessageHelpers = {
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
* 2.0.
|
* 2.0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* istanbul ignore file */
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -26,6 +26,7 @@ import { EngineRouter, EngineNav } from './components/engine';
|
||||||
import { EngineCreation } from './components/engine_creation';
|
import { EngineCreation } from './components/engine_creation';
|
||||||
import { EnginesOverview } from './components/engines';
|
import { EnginesOverview } from './components/engines';
|
||||||
import { ErrorConnecting } from './components/error_connecting';
|
import { ErrorConnecting } from './components/error_connecting';
|
||||||
|
import { Library } from './components/library';
|
||||||
import { MetaEngineCreation } from './components/meta_engine_creation';
|
import { MetaEngineCreation } from './components/meta_engine_creation';
|
||||||
import { RoleMappingsRouter } from './components/role_mappings';
|
import { RoleMappingsRouter } from './components/role_mappings';
|
||||||
import { SetupGuide } from './components/setup_guide';
|
import { SetupGuide } from './components/setup_guide';
|
||||||
|
@ -147,6 +148,28 @@ describe('AppSearchConfigured', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('library', () => {
|
||||||
|
it('renders a library page in development', () => {
|
||||||
|
const OLD_ENV = process.env.NODE_ENV;
|
||||||
|
process.env.NODE_ENV = 'development';
|
||||||
|
|
||||||
|
rerender(wrapper);
|
||||||
|
|
||||||
|
expect(wrapper.find(Library)).toHaveLength(1);
|
||||||
|
process.env.NODE_ENV = OLD_ENV;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("doesn't in production", () => {
|
||||||
|
const OLD_ENV = process.env.NODE_ENV;
|
||||||
|
process.env.NODE_ENV = 'production';
|
||||||
|
|
||||||
|
rerender(wrapper);
|
||||||
|
|
||||||
|
expect(wrapper.find(Library)).toHaveLength(0);
|
||||||
|
process.env.NODE_ENV = OLD_ENV;
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('AppSearchNav', () => {
|
describe('AppSearchNav', () => {
|
||||||
|
|
Loading…
Reference in a new issue