forked from MapComplete/MapComplete
Add fakedom to test UI code, replace all 'innerText' with 'textContent' as it is not compatible with fakedom
This commit is contained in:
parent
b0b674b2fb
commit
0f66d7f8cc
17 changed files with 281 additions and 20 deletions
|
@ -1,11 +1,17 @@
|
|||
import ScriptUtils from "../scripts/ScriptUtils";
|
||||
import {Utils} from "../Utils";
|
||||
import * as fakedom from "fake-dom"
|
||||
|
||||
export const mochaHooks = {
|
||||
|
||||
beforeEach(done) {
|
||||
ScriptUtils.fixUtils();
|
||||
|
||||
|
||||
if (fakedom === undefined || window === undefined) {
|
||||
throw "FakeDom not initialized"
|
||||
}
|
||||
|
||||
|
||||
// Block internet access
|
||||
const realDownloadFunc = Utils.externalDownloadFunction;
|
||||
Utils.externalDownloadFunction = async (url) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue