Skip to content

Commit

Permalink
fix test to match new theme expectation within Kibana
Browse files Browse the repository at this point in the history
  • Loading branch information
eokoneyo committed Nov 20, 2024
1 parent 3697e5a commit 85b9d5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { coreMock } from '@kbn/core/public/mocks';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import type { ILicense } from '@kbn/licensing-plugin/public';
import type { StartServices } from '../../../types';
import type { EuiTheme } from '@kbn/kibana-react-plugin/common';
import type { UseEuiTheme } from '@elastic/eui';
import { securityMock } from '@kbn/security-plugin/public/mocks';
import { spacesPluginMock } from '@kbn/spaces-plugin/public/mocks';
import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks';
Expand Down Expand Up @@ -118,5 +118,5 @@ export const createKibanaContextProviderMock = () => {
React.createElement(KibanaContextProvider, { services }, children);
};

export const getMockTheme = (partialTheme: RecursivePartial<EuiTheme>): EuiTheme =>
partialTheme as EuiTheme;
export const getMockTheme = (partialTheme: RecursivePartial<UseEuiTheme>): UseEuiTheme =>
partialTheme as UseEuiTheme;
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { getMockTheme } from '../../common/lib/kibana/kibana_react.mock';

describe('EmptyValue', () => {
const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } });
const mockTheme = getMockTheme({ euiTheme: { colors: { mediumShade: '#ece' } } });

test('it renders against snapshot', () => {
const wrapper = shallow(<p>{getEmptyString()}</p>);
Expand Down
7 changes: 2 additions & 5 deletions x-pack/plugins/cases/public/components/empty_value/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@

import { get, isString } from 'lodash/fp';
import React from 'react';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import type { UseEuiTheme } from '@elastic/eui';

import * as i18n from './translations';

const emptyWrapperCss = css`
color: ${euiThemeVars.euiColorMediumShade};
`;
const emptyWrapperCss = ({ euiTheme }: UseEuiTheme) => ({ color: euiTheme.colors.mediumShade });

export const getEmptyValue = () => '—';
export const getEmptyString = () => `(${i18n.EMPTY_STRING})`;
Expand Down

0 comments on commit 85b9d5b

Please sign in to comment.