Skip to content

Commit

Permalink
Fix jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Jan 6, 2025
1 parent 3a57a7e commit 0c4e9a4
Show file tree
Hide file tree
Showing 6 changed files with 315 additions and 678 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
pluckCategoricalStyleMetaFromFeatures,
pluckStyleMetaFromFeatures,
} from './pluck_style_meta_from_features';
import { EuiThemeComputed } from '@elastic/eui';

const euiTheme = { colors: {} } as unknown as EuiThemeComputed;

describe('pluckStyleMetaFromFeatures', () => {
test('Should identify when feature collection only contains points', async () => {
Expand Down Expand Up @@ -156,6 +159,7 @@ describe('pluckStyleMetaFromFeatures', () => {
name: 'myDynamicFieldWithNoValues',
},
} as ColorDynamicOptions;

const field = new InlineField({
fieldName: dynamicColorOptions.field!.name,
source: {} as unknown as IVectorSource,
Expand All @@ -169,7 +173,8 @@ describe('pluckStyleMetaFromFeatures', () => {
{} as unknown as IVectorLayer,
() => {
return null;
} // getFieldFormatter
}, // getFieldFormatter
euiTheme
);

const styleMeta = await pluckStyleMetaFromFeatures(features, Object.values(VECTOR_SHAPE_TYPE), [
Expand Down Expand Up @@ -232,7 +237,8 @@ describe('pluckStyleMetaFromFeatures', () => {
{} as unknown as IVectorLayer,
() => {
return null;
} // getFieldFormatter
}, // getFieldFormatter
euiTheme
);

const styleMeta = await pluckStyleMetaFromFeatures(features, Object.values(VECTOR_SHAPE_TYPE), [
Expand Down Expand Up @@ -303,7 +309,8 @@ describe('pluckStyleMetaFromFeatures', () => {
{} as unknown as IVectorLayer,
() => {
return null;
} // getFieldFormatter
}, // getFieldFormatter
euiTheme
);

const styleMeta = await pluckStyleMetaFromFeatures(features, Object.values(VECTOR_SHAPE_TYPE), [
Expand Down Expand Up @@ -399,7 +406,8 @@ describe('pluckCategoricalStyleMetaFromFeatures', () => {
{} as unknown as IVectorLayer,
() => {
return null;
} // getFieldFormatter
}, // getFieldFormatter
euiTheme
);

const categories = pluckCategoricalStyleMetaFromFeatures(dynamicColorProperty, features);
Expand Down Expand Up @@ -429,7 +437,8 @@ describe('pluckCategoricalStyleMetaFromFeatures', () => {
{} as unknown as IVectorLayer,
() => {
return null;
} // getFieldFormatter
}, // getFieldFormatter
euiTheme
);
dynamicColorProperty.getNumberOfCategories = () => {
return 1;
Expand Down
Loading

0 comments on commit 0c4e9a4

Please sign in to comment.