Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/eui/changelogs/upcoming/8844.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Bug fixes**

- Fixed wrong initialization options on `EUI_VIS_COLOR_STORE` which resulted in partially wrong initial color values for static `euiPalette{name}` functions (e.g. `euiPaletteForTemperature`)

77 changes: 77 additions & 0 deletions packages/eui/src/services/color/eui_palettes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ describe('euiPaletteForDarkBackground', () => {
});

describe('euiPaletteForStatus', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteForStatus(6, { colors });

expect(resultLong[2]).toEqual('#c8e3b8');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -107,6 +114,13 @@ describe('euiPaletteForStatus', () => {
});

describe('euiPaletteForTemperature', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteForTemperature(6, { colors });

expect(resultLong[2]).toEqual('#e8f1ff');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -121,6 +135,13 @@ describe('euiPaletteForTemperature', () => {
});

describe('euiPaletteComplementary', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteComplementary(6, { colors });

expect(resultLong[2]).toEqual('#c4dcfd');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -135,6 +156,13 @@ describe('euiPaletteComplementary', () => {
});

describe('euiPaletteRed', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteRed(6, { colors });

expect(resultLong[2]).toEqual('#feb7b0');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -149,6 +177,13 @@ describe('euiPaletteRed', () => {
});

describe('euiPaletteGreen', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteGreen(6, { colors });

expect(resultLong[2]).toEqual('#9fdfc6');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -163,6 +198,13 @@ describe('euiPaletteGreen', () => {
});

describe('euiPaletteSkyBlue', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteSkyBlue(6, { colors });

expect(resultLong[2]).toEqual('#a6d8ec');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -177,6 +219,13 @@ describe('euiPaletteSkyBlue', () => {
});

describe('euiPaletteYellow', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteYellow(6, { colors });

expect(resultLong[2]).toEqual('#f9d290');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -191,6 +240,13 @@ describe('euiPaletteYellow', () => {
});

describe('euiPaletteOrange', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteOrange(6, { colors });

expect(resultLong[2]).toEqual('#ffc1a1');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -205,6 +261,13 @@ describe('euiPaletteOrange', () => {
});

describe('euiPaletteCool', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteCool(6, { colors });

expect(resultLong[2]).toEqual('#a8caff');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -219,6 +282,13 @@ describe('euiPaletteCool', () => {
});

describe('euiPaletteWarm', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteWarm(6, { colors });

expect(resultLong[2]).toEqual('#ffafa6');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand All @@ -233,6 +303,13 @@ describe('euiPaletteWarm', () => {
});

describe('euiPaletteGray', () => {
it('should return correct colors', () => {
const colors = colorVis;
const resultLong = euiPaletteGray(6, { colors });

expect(resultLong[2]).toEqual('#7b8aa4');
});

it('should return custom colors', () => {
const customColor = '#00ff00';
const colors = {
Expand Down
2 changes: 1 addition & 1 deletion packages/eui/src/services/color/vis_color_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ import { colorVis } from '@elastic/eui-theme-borealis';

// initialsetup of Vis color storage with default colors
export const EUI_VIS_COLOR_STORE: _EuiVisColorStore =
EuiVisColorStore.getInstance(colorVis, true);
EuiVisColorStore.getInstance(colorVis, false);