Skip to content

Commit

Permalink
Remove obsolete snapshots and fix websocket undefined error (#2523)
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak authored Jan 25, 2025
1 parent 7332f79 commit f6fa719
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,6 @@ exports[`preparePriorityRuleGroupForForm > empty values are represented as an em
}
`;

exports[`preparePriorityRuleGroupForForm condition and rules are added into results, with parsed keys and values 1`] = `
{
"condition": "AND",
"rules": [
{
"key": "firstTag",
"operator": "equals",
"value": "foo",
"valueType": "string",
},
{
"key": "secondTag",
"operator": "contains",
"value": "bar",
"valueType": "string",
},
],
}
`;

exports[`preparePriorityRuleGroupForForm empty values are represented as an empty string string 1`] = `
{
"condition": "AND",
"rules": [
{
"key": "thirdTag",
"operator": "is_empty",
"value": "",
"valueType": "string",
},
],
}
`;

exports[`preparePriorityRuleGroupForSaving > condition and rules are added into results, with dot-separated key and value 1`] = `
{
"condition": "AND",
Expand Down Expand Up @@ -108,44 +74,3 @@ exports[`preparePriorityRuleGroupForSaving > empty values are represented as a s
],
}
`;

exports[`preparePriorityRuleGroupForSaving condition and rules are added into results, with dot-separated key and value 1`] = `
{
"condition": "AND",
"rules": [
{
"operator": "equals",
"type": "string",
"value": "firstTag.foo",
},
{
"operator": "contains",
"type": "string",
"value": "secondTag.bar",
},
{
"operator": "==",
"type": "integer",
"value": "fourthTag.123",
},
{
"operator": "<=",
"type": "integer",
"value": "fifthTag.456",
},
],
}
`;

exports[`preparePriorityRuleGroupForSaving empty values are represented as a space in dot-separated string 1`] = `
{
"condition": "AND",
"rules": [
{
"operator": "is_empty",
"type": "string",
"value": "thirdTag. ",
},
],
}
`;
16 changes: 16 additions & 0 deletions src/services/Editor/Editor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ let centerPoint = null;
let mapBounds = null;

beforeEach(() => {
global.WebSocket = class MockWebSocket {
constructor() {
this.onopen = null;
this.onmessage = null;
this.onclose = null;
this.onerror = null;
}

send() {}
close() {}
};

dispatch = vi.fn();

basicFeature = {
Expand Down Expand Up @@ -122,6 +134,10 @@ beforeEach(() => {
};
});

afterEach(() => {
delete global.WebSocket;
});

describe("osmObjectParams", () => {
beforeEach(() => {
pointFeature.properties.osmid = "123";
Expand Down

0 comments on commit f6fa719

Please sign in to comment.