leaflet-environmental-layers
leaflet-environmental-layers copied to clipboard
migrate gsheet api to public-google-sheets-parser to fix pfasLayer and spreadsheet utility
- migrate gsheet api to ~~v4~~
public-google-sheets-parser - ~~need of API_TOKEN * data reference not based of XML now direct json arrays~~
Fixes #553
working screenshot
Some things I wanted to note.
- I am using my personal API_TOKEN for now.
- I made a spreadsheet copy from the public csv based on the older sheet, since the sheet itself was not available but the csv was at https://docs.google.com/spreadsheets/u/0/d/1cjQ3H_DX-0dhVL5kMEesFEKaoJKLfC2wWAhokMnJxV4/pub?output=csv
Oof, will need to debug the tests too 👀
Fixed the spreadsheet utility as well
No need of API Token anymore :D and it works too.
We still need the sheet to be public though.
Will need to debug tests 😓
Just wondering if it's just not transpiled the right way! the new npm module I added.
Yes, the error is due to public-google-sheets-parser not being transpiled right. I will have to look into how to configure that in the Gruntfile.
After transpile
ReferenceError: Can't find variable: regeneratorRuntime at dist/LeafletEnvironmentalLayers_babel.js:5432
this is part of public-google-sheets-parser code.
@jywarren any hints/suggestions for how to proceed with fixing these tests?
Hmm, looking... could it be related to:
https://github.com/fureweb-com/public-google-sheets-parser/issues/3
The transpile theory makes sense... Jasmine has trouble with some untranspiled code, i think i remember.
Cypress shouldn't, but the errors there are different anyways:
1) Loads demo page
has layers menu control:
AssertionError: Timed out retrying: Too many elements found. Found '22', expected '21'.
Yay, that worked! Pointed at my own patch branch. We can repoint if they merge my PR.

Ugh - looks like I solved one issue but the original regeneratorRuntime is still there:
- leaflet is created......✓
- baselayer is added by default......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 26) (1)
- include specific layers......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
include: ['eonetFiresLayer', 'Unearthing'],
display: ['eonetFiresLayer']
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 33) (1)
- exclude specific layers......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
exclude: ['eonetFiresLayer']
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 43) (1)
- display shows layer......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
display: ['eonetFiresLayer'],
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 52) (1)
- addLayersToMap shows all included layers......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
include: ['eonetFiresLayer', 'Unearthing'],
addLayersToMap: true,
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 61) (1)
- simpleLayerControl shows simple menu......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
simpleLayerControl: true,
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 72) (1)
- embed shows embed control......X
TypeError: undefined is not a function (evaluating 'L.LayerGroup.EnvironmentalLayers({
embed: true,
})') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/basicImplementation.spec.js (line 80) (1)
embed control properties
default properties
- encountered a declaration exception......X
TypeError: undefined is not a constructor (evaluating 'new L.control.embed()') in file:///home/runner/work/leaflet-environmental-layers/leaflet-environmental-layers/spec/javascripts/embedControl.spec.js (line 8) (1)
passed in properties
Does that library by chance use async/await? https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined says we need the babel-polyfill library.
Oh... Hi 👋🏽 I will go through the updates here.
The failures right now are due to using a combination of Babel 6 ( the new deps ) and Babel 7 ( what we have already )
The failing cypress tests seems to be due to the new added test spreadsheet layer? Updating the count will do ig 🤔 If that is the case any new test will fail the test ig 👀
Updated the counts to make some progress. There are still errors related to undefineds, though -- is this ES6 incompatibility with Jasmine again?
Then, i see a bunch related to missing images in the pfas layer test. Running it manually what do you think might be happening here?
5 failing
1) Pfas layer
adds markers on click:
AssertionError: Timed out retrying: Expected to find element: `.leaflet-marker-pane img`, but never found it.
at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/pfasLayer.spec.js:17:42)
2) Pfas layer
has default markers in default mode:
AssertionError: Timed out retrying: Expected to find element: `.leaflet-marker-pane img`, but never found it.
at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/pfasLayer.spec.js:24:8)
3) Pfas layer
has circle markers in minimal mode:
AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/pfasLayer.spec.js:33:10)
4) Pfas layer
shows popup:
AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/pfasLayer.spec.js:41:8)
5) Pfas layer
removes markers from the map and the layer name from the hash when clicked again:
AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/pfasLayer.spec.js:53:8)
Retriggering tests so we can see the latest logs