-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: map component themes * material theme * tweaks to the themes * button active styles * Update packages/map/src/vaadin-map.js Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com> * restore drag-to-zoom styles * add basic visual tests for themes * Add styles for ZoomSlider and MousePosition controls * disable labels for visual tests * fix linter error * small fixes to dark themes * add hint about default control override Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
- Loading branch information
1 parent
551965f
commit 2570682
Showing
13 changed files
with
703 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { fixtureSync } from '@vaadin/testing-helpers'; | ||
import { visualDiff } from '@web/test-runner-visual-regression'; | ||
import '../../../enable'; | ||
import '../../../theme/lumo/vaadin-map.js'; | ||
import FullScreen from 'ol/control/FullScreen'; | ||
import OverviewMap from 'ol/control/OverviewMap'; | ||
import Rotate from 'ol/control/Rotate'; | ||
import ScaleLine from 'ol/control/ScaleLine'; | ||
import View from 'ol/View'; | ||
|
||
describe('map', () => { | ||
let div, element; | ||
|
||
beforeEach(() => { | ||
div = document.createElement('div'); | ||
div.style.width = '400px'; | ||
div.style.height = '400px'; | ||
div.style.position = 'relative'; | ||
div.style.padding = '10px'; | ||
element = fixtureSync('<vaadin-map></vaadin-map>', div); | ||
element.style.width = '100%'; | ||
element.style.height = '100%'; | ||
// Set non-white background to identify controls more clearly | ||
element.style.background = '#eadbc8'; | ||
// Force size refresh | ||
element.configuration.updateSize(); | ||
// Define a viewport | ||
element.configuration.setView( | ||
new View({ | ||
center: [0, 0], | ||
zoom: 3 | ||
}) | ||
); | ||
}); | ||
|
||
describe('controls', () => { | ||
it('all controls', async () => { | ||
// Add non-default controls | ||
element.configuration.getControls().push(new FullScreen({ label: '', labelActive: '' })); | ||
element.configuration.getControls().push(new Rotate({ label: '' })); | ||
element.configuration.getControls().push(new ScaleLine()); | ||
element.configuration.getControls().push(new OverviewMap({ label: '', collapseLabel: '' })); | ||
await visualDiff(div, 'controls-all-controls'); | ||
}); | ||
}); | ||
|
||
describe('theme', () => { | ||
it('borderless', async () => { | ||
element.setAttribute('theme', 'borderless'); | ||
await visualDiff(div, 'theme-borderless'); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+5.63 KB
packages/map/test/visual/lumo/screenshots/map/baseline/controls-all-controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.02 KB
packages/map/test/visual/lumo/screenshots/map/baseline/theme-borderless.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.