fix: add support for leaflet 1.8.0 (#327)

This commit is contained in:
Valentin Kunz
2022-06-07 07:38:46 +00:00
committed by GitHub
parent dd4bf632da
commit ab253746fb
3 changed files with 13 additions and 1 deletions

View File

@@ -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
@@ -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:

View File

@@ -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();

View File

@@ -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' }));
});