Skip to content

Commit

Permalink
test: fix @elastic/charts mock including themes objects
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Mar 16, 2020
1 parent 3bd5f54 commit 059e34d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ export const ScaleType = {

export const BarSeries = () => null;
export const AreaSeries = () => null;

export { LIGHT_THEME, DARK_THEME } from '@elastic/charts';
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('TSVB theme', () => {
});
it('should return a highcontrast color theme for a different background', () => {
// red use a near full-black color
expect(getTheme(false, 'red').axes.axisTitleStyle.fill).toEqual('rgb(25,25,25)');
expect(getTheme(false, 'red').axes.axisTitleStyle.fill).toEqual('rgb(23,23,23)');

// violet increased the text color to full white for higer contrast
expect(getTheme(false, '#ba26ff').axes.axisTitleStyle.fill).toEqual('rgb(255,255,255)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ function isValidColor(color: string | null | undefined): color is string {
if (typeof color !== 'string') {
return false;
}
if (color.length === 0) {
return false;
}
try {
colorJS(color);
return true;
Expand Down

0 comments on commit 059e34d

Please sign in to comment.