Skip to content

Commit

Permalink
fix @wq/map tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Aug 12, 2022
1 parent eb238c0 commit 1bbbe37
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 23 deletions.
13 changes: 7 additions & 6 deletions packages/map/src/__tests__/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
contextFeatureCollection
} from '../hooks';
import { AutoMap } from '../components';
import { EmbeddedGeo } from '../inputs';
import react from '@wq/react';
import { Geo } from '../inputs';
import react, { Form } from '@wq/react';
import renderTest from '@wq/react/test';
import routeConfig from './config.json';
import geojson from './geojson.json';
Expand Down Expand Up @@ -430,10 +430,11 @@ test('edit map', async () => {
}
);

const Component = EmbeddedGeo.makeComponent({
type: 'geopoint',
value: point
});
const Component = () => (
<Form data={{ point: point }}>
<Geo type="geopoint" name="point" />
</Form>
);

const result = renderTest(Component, mockApp),
overlay = result.root.findByType(Draw);
Expand Down
3 changes: 1 addition & 2 deletions packages/map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
LegendIcon,
GeoTools
} from './components/index';
import { Geo, EmbeddedGeo } from './inputs/index';
import { Geo } from './inputs/index';
import { GeoHelp, GeoLocate, GeoCode, GeoCoords } from './geotools/index';
import { DefaultList, DefaultDetail } from './views/index';

Expand Down Expand Up @@ -55,7 +55,6 @@ export {
LegendIcon,
GeoTools,
Geo,
EmbeddedGeo,
GeoHelp,
GeoLocate,
GeoCode,
Expand Down
4 changes: 2 additions & 2 deletions packages/map/src/inputs/Geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export default function Geo({
Geo.propTypes = {
name: PropTypes.string,
type: PropTypes.string,
required: PropTypes.boolean,
required: PropTypes.bool,
label: PropTypes.string,
hint: PropTypes.string,
inset: PropTypes.boolean,
inset: PropTypes.bool,
children: PropTypes.node
};

Expand Down
3 changes: 3 additions & 0 deletions packages/map/src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ const map = {
},
Draw({ type, data }) {
return `Draw ${data ? data.type : type}`;
},
Accuracy({ accuracy }) {
return `Accuracy ${accuracy}`;
}
},
geotools: {
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/components/CheckboxButton.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Fragment } from 'react';

export default Fragment;
export default function CheckboxButton() {
return null;
}
2 changes: 1 addition & 1 deletion packages/react/src/components/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export default function ListItem({ children, description, icon, ...rest }) {
ListItem.propTypes = {
children: PropTypes.node,
description: PropTypes.node,
icon: PropTypes.string
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.func])
};
6 changes: 3 additions & 3 deletions packages/react/src/components/RadioButton.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Fragment } from 'react';

export default Fragment;
export default function RadioButton() {
return null;
}
11 changes: 9 additions & 2 deletions packages/react/src/components/SidePanel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import { Fragment } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

export default Fragment;
export default function SidePanel({ children }) {
return <>{children}</>;
}

SidePanel.propTypes = {
children: PropTypes.node
};
6 changes: 3 additions & 3 deletions packages/react/src/components/Switch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Fragment } from 'react';

export default Fragment;
export default function Switch() {
return null;
}
2 changes: 1 addition & 1 deletion packages/react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
...app,
plugins: { ...app.plugins }
},
config: {},
config: { messages: {} },
registry: {
components: {},
inputs: {},
Expand Down

0 comments on commit 1bbbe37

Please sign in to comment.