Skip to content

Commit 159b048

Browse files
authored
fix(v3): fix visibility issue excluding only null and undefined values from props
* fix(v3): exclude only null and undefined values from props * fix(v3): fix e2e polyline test adding lodash.throttle * test(v3): improve e2e marker test adding visibility test * test(v3): improve dev server in order to debug it and some scripts * chore(root): fix lint-staged configuration * test(v3): test markers visibility * test(v3): update all test videos
1 parent f68602d commit 159b048

19 files changed

+127
-44
lines changed

.lintstagedrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"*.{vue,js,vue,html,js}":
1+
"*.{vue,js,ts,jsx,tsx}":
22
- "pnpm run lint"

packages/v3/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules
77
/cypress/runner/dist
88

99
# local env files
10+
.env
1011
.env.local
1112
.env.*.local
1213

packages/v3/cypress/e2e/marker-icon.cy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,19 @@ describe('MarkerIcon component', () => {
44
cy.get('button[name=marker]').click();
55
cy.get('.gmv-map').find('map').should('have.length', 2);
66
});
7+
8+
it('should remove all markers from the map', function () {
9+
cy.visit('/');
10+
cy.get('button[name=marker]').click();
11+
cy.get('#visibility').click();
12+
cy.get('.gmv-map').find('map').should('have.length', 0);
13+
});
14+
15+
it('should re-add all markers on the map', function () {
16+
cy.visit('/');
17+
cy.get('button[name=marker]').click();
18+
cy.get('#visibility').click();
19+
cy.get('#visibility').click();
20+
cy.get('.gmv-map').find('map').should('have.length', 2);
21+
});
722
});

packages/v3/cypress/runner/components/MarkerTest.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<template>
2+
<button id="visibility" type="button" @click="visible = !visible">
3+
{{ btnTxt }}
4+
</button>
5+
<br /><br />
26
<gmv-map :center="center" :zoom="7" style="width: 100%; height: 500px">
37
<gmv-marker
48
v-for="(m, i) in markers"
@@ -7,6 +11,7 @@
711
:draggable="true"
812
:position="m.position"
913
@click="center = m.position"
14+
:visible="visible"
1015
></gmv-marker>
1116
</gmv-map>
1217
</template>
@@ -15,6 +20,7 @@
1520
export default {
1621
data() {
1722
return {
23+
visible: true,
1824
center: {
1925
lat: 10.0,
2026
lng: 10.0,
@@ -35,5 +41,10 @@ export default {
3541
],
3642
};
3743
},
44+
computed: {
45+
btnTxt() {
46+
return this.visible ? 'Hide markers' : 'Show markers';
47+
},
48+
},
3849
};
3950
</script>

packages/v3/cypress/runner/components/PolylineTest.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
</template>
3636

3737
<script>
38+
import throttle from 'lodash.throttle';
39+
3840
export default {
3941
data() {
4042
return {
@@ -50,7 +52,7 @@ export default {
5052
};
5153
},
5254
watch: {
53-
polylinePath: window?._.throttle(function (path) {
55+
polylinePath: throttle(function (path) {
5456
if (path) {
5557
this.path = path;
5658
this.polylineGeojson = JSON.stringify(
-7.34 KB
Binary file not shown.
4.52 KB
Binary file not shown.
98.4 KB
Binary file not shown.
100 KB
Binary file not shown.
-7.24 KB
Binary file not shown.

0 commit comments

Comments
 (0)