diff --git a/dom/pick-and-click_test.js b/dom/pick-and-click_test.js index 9528c1b8..2672e9aa 100644 --- a/dom/pick-and-click_test.js +++ b/dom/pick-and-click_test.js @@ -77,16 +77,17 @@ tests.push(async ({ page, eq, bodyBgRgb, random }) => { tests.push(async ({ page, eq, bodyBgRgb, random }) => { // check that the hsl value is copied in the clipboard on click for (const move of generateCoords(random)) { - await page.mouse.click(...move) - const clipboard = await page.evaluate(() => { - // mock clipboard + await page.evaluate(() => { let clipboardText = null - window["navigator"]["clipboard"] = { - writeText: (text) => new Promise((resolve) => (clipboardText = text)), - readText: () => new Promise((resolve) => resolve(clipboardText)), - } - return navigator.clipboard.readText() + window.navigator.clipboard.readText = () => + new Promise((resolve) => resolve(clipboardText)) + window.navigator.clipboard.writeText = (text) => + new Promise(() => (clipboardText = text)) }) + await page.mouse.click(...move) + const clipboard = await page.evaluate(() => + window.navigator.clipboard.readText() + ) const hslValue = await page.$eval(".hsl", (hsl) => hsl.textContent) eq(hslValue, clipboard) } diff --git a/js/tests/get-json_test.js b/js/tests/get-json_test.js index e5d0d6d2..7b3a7145 100644 --- a/js/tests/get-json_test.js +++ b/js/tests/get-json_test.js @@ -14,7 +14,7 @@ t(async ({ eq }) => { // check url parsing let url fetch = async (arg) => fakeFetch({ url: (url = arg) }) - const pending = getJSON('/test', { query: 'hello world', b: 5 }) + const pending = await getJSON('/test', { query: 'hello world', b: 5 }) return eq(url, '/test?query=hello+world&b=5') }) diff --git a/subjects/pronoun/README.md b/subjects/pronoun/README.md index 0e47aa92..f727fe9f 100644 --- a/subjects/pronoun/README.md +++ b/subjects/pronoun/README.md @@ -3,8 +3,8 @@ ### Instructions Create a function called `pronoun` that has a string as parameter. This function returns an object -that will have all the pronouns, present in the string, as keys. Each key will have a sub object with the -first word after each of the pronouns found in the string. +that will have all the personal pronouns, present in the string, as keys. Each key will have a sub object with the +first word after each of the personal pronouns found in the string. Also, a property `count` must be added, to the sub object, with the amount of occurrences of the pronoun. #### Example