Update mock tests to use locator.fill instead of .type
This commit is contained in:
parent
09f1c15a3e
commit
2497d0d8a1
2 changed files with 6 additions and 8 deletions
|
@ -32,14 +32,16 @@ export async function typeIntoInput(
|
||||||
currentValue = (await input.textContent()) ?? '';
|
currentValue = (await input.textContent()) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
await input.type(text, { delay: 30 });
|
const newValue = `${currentValue}${text}`;
|
||||||
|
|
||||||
|
await input.fill(newValue);
|
||||||
|
|
||||||
// Wait to ensure that the input (and react state controlling it) has actually
|
// Wait to ensure that the input (and react state controlling it) has actually
|
||||||
// updated with the right value
|
// updated with the right value
|
||||||
if (isInputElement) {
|
if (isInputElement) {
|
||||||
await expect(input).toHaveValue(`${currentValue}${text}`);
|
await expect(input).toHaveValue(newValue);
|
||||||
} else {
|
} else {
|
||||||
await input.locator(`:text("${currentValue}${text}")`).waitFor();
|
await input.locator(`:text("${newValue}")`).waitFor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,11 +117,7 @@ describe('storage service', function (this: Mocha.Suite) {
|
||||||
}
|
}
|
||||||
|
|
||||||
debug('Enter message text');
|
debug('Enter message text');
|
||||||
const composeArea = window.locator(
|
const input = await app.waitForEnabledComposer();
|
||||||
'.composition-area-wrapper, .Inbox__conversation .ConversationView'
|
|
||||||
);
|
|
||||||
const input = composeArea.locator('[data-testid=CompositionInput]');
|
|
||||||
|
|
||||||
await typeIntoInput(input, 'hello stranger!');
|
await typeIntoInput(input, 'hello stranger!');
|
||||||
await input.press('Enter');
|
await input.press('Enter');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue