forked from MapComplete/MapComplete
Chore: reformat all files with prettier
This commit is contained in:
parent
5757ae5dea
commit
d008dcb54d
214 changed files with 8926 additions and 8196 deletions
|
@ -652,10 +652,12 @@ describe("RelationSplitHandler", () => {
|
|||
"no-theme",
|
||||
downloader
|
||||
)
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(new Changes({
|
||||
dryRun: new ImmutableStore(false),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(false),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
const allIds = changeDescription[0].changes["members"].map((m) => m.ref).join(",")
|
||||
const expected = "687866206,295132739,-1,690497698"
|
||||
// "didn't find the expected order of ids in the relation to test"
|
||||
|
@ -707,10 +709,12 @@ describe("RelationSplitHandler", () => {
|
|||
"no-theme",
|
||||
downloader
|
||||
)
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(new Changes({
|
||||
dryRun: new ImmutableStore(false),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(false),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
const allIds = changeDescription[0].changes["members"]
|
||||
.map((m) => m.type + "/" + m.ref + "-->" + m.role)
|
||||
.join(",")
|
||||
|
|
|
@ -6,7 +6,7 @@ import { describe, expect, it } from "vitest"
|
|||
import { OsmConnection } from "../../../../Logic/Osm/OsmConnection"
|
||||
import { ImmutableStore } from "../../../../Logic/UIEventSource"
|
||||
import { Changes } from "../../../../Logic/Osm/Changes"
|
||||
import FullNodeDatabaseSource from "../../../../Logic/FeatureSource/TiledFeatureSource/FullNodeDatabaseSource";
|
||||
import FullNodeDatabaseSource from "../../../../Logic/FeatureSource/TiledFeatureSource/FullNodeDatabaseSource"
|
||||
|
||||
describe("ReplaceGeometryAction", () => {
|
||||
const grbStripped = {
|
||||
|
@ -886,7 +886,7 @@ describe("ReplaceGeometryAction", () => {
|
|||
fullNodeDatabase.handleOsmJson(data, 0, 0, 0)
|
||||
const changes = new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
const osmConnection = new OsmConnection({
|
||||
dryRun: new ImmutableStore(true),
|
||||
|
|
|
@ -2,8 +2,8 @@ import { Utils } from "../../../../Utils"
|
|||
import SplitAction from "../../../../Logic/Osm/Actions/SplitAction"
|
||||
import { Changes } from "../../../../Logic/Osm/Changes"
|
||||
import { describe, expect, it } from "vitest"
|
||||
import {OsmConnection} from "../../../../Logic/Osm/OsmConnection";
|
||||
import {ImmutableStore} from "../../../../Logic/UIEventSource";
|
||||
import { OsmConnection } from "../../../../Logic/Osm/OsmConnection"
|
||||
import { ImmutableStore } from "../../../../Logic/UIEventSource"
|
||||
|
||||
describe("SplitAction", () => {
|
||||
{
|
||||
|
@ -2689,10 +2689,12 @@ describe("SplitAction", () => {
|
|||
const splitter = new SplitAction(id, [splitPoint], {
|
||||
theme: "test",
|
||||
})
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
|
||||
expect(changeDescription[0].type).toBe("node")
|
||||
expect(changeDescription[0].id).toBe(-1)
|
||||
|
@ -2717,10 +2719,12 @@ describe("SplitAction", () => {
|
|||
const splitter = new SplitAction(id, [splitPoint], {
|
||||
theme: "test",
|
||||
})
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
|
||||
expect(changeDescription.length).toBe(2)
|
||||
expect(changeDescription[0].type).toBe("way")
|
||||
|
@ -2737,10 +2741,12 @@ describe("SplitAction", () => {
|
|||
const splitter = new SplitAction(id, [splitPoint], {
|
||||
theme: "test",
|
||||
})
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changeDescription = await splitter.CreateChangeDescriptions(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
|
||||
// Should be a new node
|
||||
expect(changeDescription[0].type).toBe("node")
|
||||
|
@ -2753,10 +2759,12 @@ describe("SplitAction", () => {
|
|||
const splitAction = new SplitAction("way/941079939", [splitPointAroundP3], {
|
||||
theme: "test",
|
||||
})
|
||||
const changes = await splitAction.Perform(new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changes = await splitAction.Perform(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
console.log(changes)
|
||||
// 8715440368 is the expected point of the split
|
||||
|
||||
|
@ -2794,10 +2802,12 @@ describe("SplitAction", () => {
|
|||
{ theme: "test" },
|
||||
1
|
||||
)
|
||||
const changes = await splitAction.Perform(new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection()
|
||||
}))
|
||||
const changes = await splitAction.Perform(
|
||||
new Changes({
|
||||
dryRun: new ImmutableStore(true),
|
||||
osmConnection: new OsmConnection(),
|
||||
})
|
||||
)
|
||||
|
||||
// THe first change is the creation of the new node
|
||||
expect(changes[0].type).toEqual("node")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue