Skip to content

Commit

Permalink
Fixup: Fix broken unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ianguerin committed Jun 5, 2024
1 parent 3392635 commit b7b3da1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/collections/maps/viewfinder/ZoomPresets.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define([
const zoomPresets = zoomPresetObjects.map((zoomPresetObj) => {
const enabledLayerIds = [];
const enabledLayerLabels = [];
for (const layer of allLayers) {
for (const layer of allLayers.models) {

Check failure on line 35 in src/js/collections/maps/viewfinder/ZoomPresets.js

View workflow job for this annotation

GitHub Actions / Run All Checks

[eslint] reported by reviewdog 🐶 iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations. Raw Output: {"ruleId":"no-restricted-syntax","severity":2,"message":"iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.","line":35,"column":13,"nodeType":"ForOfStatement","messageId":"restrictedSyntax","endLine":44,"endColumn":14}
if (
zoomPresetObj.layerIds?.find(
(id) => id === layer.get("layerId"),
Expand Down
3 changes: 0 additions & 3 deletions src/js/models/maps/viewfinder/ViewfinderModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ define([
return;
}

// Unset error so the error will fire a change event even if it is the
// same error as already exists.
this.unset("error", { silent: true });
// Unset error so the error will fire a change event even if it is the
// same error as already exists.
this.unset("error", { silent: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ define([

it("shows zoom presets UI when enabled in config", () => {
const view = new ViewfinderView({
model: new Map({ zoomPresets: [{}] }),
});
model: new Map({ zoomPresets: [{}], allLayers: { models: [] } })
}, { parse: true });

const harness = new ViewfinderViewHarness(view);
view.render();

Expand Down

0 comments on commit b7b3da1

Please sign in to comment.