Skip to content

Commit

Permalink
fix spelling typo, update tests, fix JS formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenerdelyi committed Nov 9, 2024
1 parent 127029d commit 55eb3d0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build/blocks/venue/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('moment', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '6c4dafb4bfafc169f2b8');
<?php return array('dependencies' => array('moment', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-element', 'wp-i18n'), 'version' => '753ebd583bfa155ab7d8');
2 changes: 1 addition & 1 deletion build/blocks/venue/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/blocks/venue/venue.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '00a9b9f309e70276f9b5');
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => 'cce266fc46f34bf0d09d');
2 changes: 1 addition & 1 deletion build/blocks/venue/venue.js

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions src/components/GoogleMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
*
* @since 1.0.0
*
* @param {Object} props - Component properties.
* @param {string} props.location - The location to be displayed on the map.
* @param {number} props.latitude - The latitude coordinate to be displayed on the map.
* @param {number} props.longitude - The longitude coordinate to be displayed on the map.
* @param {number} [props.zoom=10] - The zoom level of the map.
* @param {string} [props.type='m'] - The type of the map (e.g., 'm' for roadmap).
* @param {number} [props.height=300] - The height of the map container.
* @param {string} [props.className] - Additional CSS class names for styling.
* @param {Object} props - Component properties.
* @param {string} props.location - The location to be displayed on the map.
* @param {number} props.latitude - The latitude coordinate to be displayed on the map.
* @param {number} props.longitude - The longitude coordinate to be displayed on the map.
* @param {number} [props.zoom=10] - The zoom level of the map.
* @param {string} [props.type='m'] - The type of the map (e.g., 'm' for roadmap).
* @param {number} [props.height=300] - The height of the map container.
* @param {string} [props.className] - Additional CSS class names for styling.
*
* @return {JSX.Element} The rendered React component.
*/
const GoogleMap = (props) => {
const { zoom, type, className, location, latitude, longitude, height } = props;
const { zoom, type, className, location, latitude, longitude, height } =
props;

const style = { border: 0, height, width: '100%' };
const baseUrl = 'https://maps.google.com/maps';
Expand Down
2 changes: 1 addition & 1 deletion src/components/MapEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const MapEmbed = (props) => {
const isAdmin = select('core')?.canUser('create', 'posts');
const isPostEditor = Boolean(select('core/edit-post'));
const { zoom, type, className, latitude, longitude } = props;
let { location, height, mapCustomLatLong } = props;
let { location, height } = props;

if (!height) {
height = 300;
Expand Down
8 changes: 5 additions & 3 deletions test/unit/js/src/components/MapEmbed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ test('Google MapEmbed returns address in source when location is set', () => {
},
};
const { container } = render(
<MapEmbed location="50 South Fullerton Avenue, Montclair, NJ 07042" />
<MapEmbed location="50 South Fullerton Avenue, Montclair, NJ 07042" latitude="40.8117036" longitude="-74.2187738" />

Check failure on line 48 in test/unit/js/src/components/MapEmbed.test.js

View workflow job for this annotation

GitHub Actions / JavaScript Coding Standards

Replace `·location="50·South·Fullerton·Avenue,·Montclair,·NJ·07042"·latitude="40.8117036"·longitude="-74.2187738"·` with `⏎↹↹↹location="50·South·Fullerton·Avenue,·Montclair,·NJ·07042"⏎↹↹↹latitude="40.8117036"⏎↹↹↹longitude="-74.2187738"⏎↹↹`
);

expect(container.children[0].getAttribute('src')).toContain(
'?q=50+South+Fullerton+Avenue%2C+Montclair%2C+NJ+07042'
'?q=40.8117036%2C-74.2187738'
);
expect(container.children[0].getAttribute('src')).toContain('&z=10');
expect(container.children[0].getAttribute('src')).toContain('&t=m');
Expand All @@ -65,14 +65,16 @@ test('MapEmbed returns address in source when location, zoom, map type, height,
const { container } = render(
<MapEmbed
location="50 South Fullerton Avenue, Montclair, NJ 07042"
latitude="40.8117036"
longitude="-74.2187738"
zoom={20}
type="k"
className="unit-test"
height={100}
/>
);
expect(container.children[0].getAttribute('src')).toContain(
'q=50+South+Fullerton+Avenue%2C+Montclair%2C+NJ+07042'
'?q=40.8117036%2C-74.2187738'
);
expect(container.children[0].getAttribute('src')).toContain('&z=20');
expect(container.children[0].getAttribute('src')).toContain('&t=k');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function test_datetime(): void {
);
$this->assertTrue(
Validate::datetime( '2023-05-11 08:30:00' ),
'Failed to assert valid datatime.'
'Failed to assert valid datetime.'
);
}

Expand Down

0 comments on commit 55eb3d0

Please sign in to comment.