mirror of
https://github.com/jlengrand/leaflet-geosearch.git
synced 2026-03-10 00:21:20 +00:00
fix: add support for leaflet 1.8.0 (#327)
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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' }));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user