Skip to content

Commit

Permalink
update snap
Browse files Browse the repository at this point in the history
add unit tests

functional boiler plate

fine tune

remove cruft
  • Loading branch information
thomasneirynck committed Aug 21, 2020
1 parent 2f1a03e commit b7504b3
Show file tree
Hide file tree
Showing 7 changed files with 480 additions and 20 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,46 @@ const defaultProps = {
topHitsSplitField: null,
topHitsSize: 1,
supportsMvt: false,
mvtDisabledReason: 'no geoshape',
};

test('should render', async () => {
const component = shallow(<ScalingForm {...defaultProps} />);
describe('scaling form', () => {
test('should render', async () => {
const component = shallow(<ScalingForm {...defaultProps} />);

expect(component).toMatchSnapshot();
});
expect(component).toMatchSnapshot();
});

test('should disable clusters option when clustering is not supported', async () => {
const component = shallow(
<ScalingForm
{...defaultProps}
supportsClustering={false}
clusteringDisabledReason="Simulated clustering disabled"
/>
);
test('should disable clusters option when clustering is not supported', async () => {
const component = shallow(
<ScalingForm
{...defaultProps}
supportsClustering={false}
clusteringDisabledReason="Simulated clustering disabled"
/>
);

expect(component).toMatchSnapshot();
});
expect(component).toMatchSnapshot();
});

test('should render top hits form when scaling type is TOP_HITS', async () => {
const component = shallow(
<ScalingForm {...defaultProps} scalingType={SCALING_TYPES.TOP_HITS} />
);

expect(component).toMatchSnapshot();
});

test('should render top hits form when scaling type is TOP_HITS', async () => {
const component = shallow(<ScalingForm {...defaultProps} scalingType={SCALING_TYPES.TOP_HITS} />);
test('should include mvt', async () => {
const component = shallow(
<ScalingForm
{...defaultProps}
supportsMvt={true}
mvtDisabledReason={'this should be ignored'}
scalingType={SCALING_TYPES.MVT}
/>
);

expect(component).toMatchSnapshot();
expect(component).toMatchSnapshot();
});
});
Loading

0 comments on commit b7504b3

Please sign in to comment.