Skip to content
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

fix: add support for leaflet 1.8.0 #327

Merged
merged 2 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:
runs-on: ubuntu-latest
needs: [setup]
timeout-minutes: 5
strategy:
matrix:
leaflet: ["1.6.0", "1.7.1", "1.8.0"]
steps:
- uses: actions/checkout@v2

Expand All @@ -96,6 +99,9 @@ jobs:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: install specific leaflet version
run: npm install leaflet@${{ matrix.leaflet }}

- name: unit tests
run: npm run ci:test
env:
Expand Down
2 changes: 1 addition & 1 deletion src/SearchControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const Control: SearchControl = {
}

// merge given options with control defaults
this.options = { ...this.options, ...options };
this.options = { ...defaultOptions, ...options };
this.classNames = { ...this.classNames, ...options.classNames };

this.markers = new L.FeatureGroup();
Expand Down
6 changes: 6 additions & 0 deletions src/__tests__/SearchControl.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ test('Change view on result', () => {

expect(map.setView).toHaveBeenCalled();
});

test('Default options are applied', () => {
const control = new SearchControl({ provider: jest.fn() });

expect(control.options).toEqual(expect.objectContaining({ style: 'button' }));
});