2023-01-11 21:47:20 +01:00
|
|
|
const { injectMockData } = require("../../utils/weather_mocker");
|
2023-03-22 23:53:10 +01:00
|
|
|
const helpers = require("./global-setup");
|
2022-10-04 10:15:24 +02:00
|
|
|
|
|
|
|
exports.getText = async (element, result) => {
|
|
|
|
const elem = await helpers.waitForElement(element);
|
|
|
|
expect(elem).not.toBe(null);
|
|
|
|
expect(
|
|
|
|
elem.textContent
|
|
|
|
.trim()
|
|
|
|
.replace(/(\r\n|\n|\r)/gm, "")
|
|
|
|
.replace(/[ ]+/g, " ")
|
|
|
|
).toBe(result);
|
|
|
|
};
|
|
|
|
|
2023-01-11 21:47:20 +01:00
|
|
|
exports.startApp = async (configFileName, additionalMockData) => {
|
|
|
|
injectMockData(configFileName, additionalMockData);
|
2022-10-29 22:34:17 +02:00
|
|
|
await helpers.startApplication("");
|
2022-10-04 10:15:24 +02:00
|
|
|
await helpers.getDocument();
|
|
|
|
};
|