forked from MapComplete/MapComplete
First steps for a delete button
This commit is contained in:
parent
b7798a470c
commit
985e97d43b
10 changed files with 246 additions and 75 deletions
32
test/OsmObject.spec.ts
Normal file
32
test/OsmObject.spec.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import T from "./TestHelper";
|
||||
import {OsmObject} from "../Logic/Osm/OsmObject";
|
||||
import ScriptUtils from "../scripts/ScriptUtils";
|
||||
|
||||
export default class OsmObjectSpec extends T {
|
||||
constructor() {
|
||||
super("OsmObject", [
|
||||
[
|
||||
"Download referencing ways",
|
||||
() => {
|
||||
let downloaded = false;
|
||||
OsmObject.DownloadReferencingWays("node/1124134958", ways => {
|
||||
downloaded = true;
|
||||
console.log(ways)
|
||||
})
|
||||
let timeout = 10
|
||||
while (!downloaded && timeout >= 0) {
|
||||
ScriptUtils.sleep(1000)
|
||||
|
||||
timeout--;
|
||||
}
|
||||
if(!downloaded){
|
||||
throw "Timeout: referencing ways not found"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue