mirror of https://github.com/01-edu/public.git
public issues
This commit is contained in:
parent
2f2f3feecd
commit
a622a6dc92
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue