Skip to content

Commit

Permalink
feat: add default size for map component (#3460)
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker authored Feb 18, 2022
1 parent dd40f27 commit 0a8c2b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 0 additions & 6 deletions dev/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Map</title>
<script type="module" src="./common.js"></script>
<style>
vaadin-map {
width: 100%;
height: 400px;
}
</style>
</head>
<body>
<script type="module">
Expand Down
4 changes: 3 additions & 1 deletion packages/map/src/vaadin-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class Map extends ResizeMixin(FocusMixin(ElementMixin(ThemableMixin(PolymerEleme
<style>
:host {
display: block;
width: 100%;
height: 400px;
flex: 1 1 auto;
align-self: stretch;
overflow: hidden;
}
Expand Down
2 changes: 0 additions & 2 deletions packages/map/test/map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ describe('configuration in detached state', () => {

beforeEach(() => {
map = document.createElement('vaadin-map');
map.style.width = '100px';
map.style.height = '100px';
});

afterEach(() => {
Expand Down
6 changes: 6 additions & 0 deletions packages/map/test/styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ describe('vaadin-map styles', () => {
displayValue = getComputedStyle(map).display;
expect(displayValue).to.equal('none');
});

it('should have a default size', () => {
const computedStyles = getComputedStyle(map);
expect(parseInt(computedStyles.width)).to.be.gt(0);
expect(parseInt(computedStyles.height)).to.equal(400);
});
});

0 comments on commit 0a8c2b9

Please sign in to comment.