-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #560 google map web component #622
Conversation
7ba9ffc
to
d0da1d3
Compare
d0da1d3
to
9a940e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better than v1 - just needs a bit of tidy up and a few tests. Good work though, appreciate it's a new thing and not necessarily clear what the best patterns are yet
functions: 90, | ||
lines: 98, | ||
statements: 97, | ||
functions: 70, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a big drop in test coverage - we should work on this
Go: 4, | ||
}, | ||
BicyclingLayer: jest.fn().mockImplementation(function() { | ||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why all the ts-ignores - surely the mock should conform to the type?
price: string | ||
} | ||
|
||
export const getContent = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not make sense as a svelte component? I get why you wouldn't when it was a React component but Svelte is just HTML and CSS - we could get rid of the inline styles too
@@ -0,0 +1,34 @@ | |||
import svelte from 'rollup-plugin-svelte' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this file is needed anymore
import GoogleMap from '../google-map.svelte' | ||
import { render } from '@testing-library/svelte' | ||
import { get } from 'svelte/store' | ||
// import { loader } from '../../../../common/utils/loader' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed
let mapLoading: boolean = false | ||
|
||
const unsubscribeSearchWidgetStore = searchWidgetStore.subscribe(store => { | ||
if (map && storeInstance && storeInstance.properties !== store.properties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a note to me - I am not sure this is the best solution but will try and come up with something better - leave for now!
createMockFuncsFromArray(instance, ['bindTo', 'get', 'notify', 'set', 'setValues', 'unbind', 'unbindAll']) | ||
} | ||
|
||
const maps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mock gets loaded in the jest-setup file at the root of the project - might be not necessary at all!
searchType?: SearchType | ||
searchKeyword?: string | ||
markers: google.maps.Marker[] | ||
mapLoading: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think mapLoading is not now referenced in the code, if not, we can remove
expect(createMarker).toHaveBeenCalledTimes(1) | ||
}) | ||
|
||
// it('should return correctly when no properties', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment about tests - we should test this function better - it is quite complex - recommend as a start point breaking down into blocks and testing them separately. Happy to help with this
import { SearchWidgetStore } from '../core/store' | ||
import { Writable } from 'svelte/store' | ||
|
||
export const showPropertiesMarker = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous - it's quite complex!
2770f45
to
09deee5
Compare
c642ef4
to
5cff980
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to go now 👍
No description provided.