Browse Source

public issues

pull/971/head
miguel 2 years ago
parent
commit
a622a6dc92
  1. 17
      dom/pick-and-click_test.js
  2. 2
      js/tests/get-json_test.js
  3. 4
      subjects/pronoun/README.md

17
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)
}

2
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')
})

4
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

Loading…
Cancel
Save