Skip to content

Commit

Permalink
fix: add support for leaflet 1.8.0 (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkunz authored Jun 7, 2022
1 parent dd4bf63 commit ab25374
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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' }));
});

0 comments on commit ab25374

Please sign in to comment.