Blocking behaviour while typing fixed + added spinner (#6)
* Some README tweaks * Next's staticProps blocking beheaviour while typing fixed + Added spinner * Testing for previous fix * Faker deprecational update
This commit is contained in:
@@ -61,7 +61,7 @@ describe("getStaticProps", () => {
|
||||
|
||||
describe("Page", () => {
|
||||
const translationRes = faker.random.words();
|
||||
const randomAudio = Array.from({ length: 10 }, () => faker.random.number(100));
|
||||
const randomAudio = Array.from({ length: 10 }, () => faker.datatype.number(100));
|
||||
const audio = {
|
||||
source: randomAudio,
|
||||
target: randomAudio
|
||||
@@ -84,11 +84,17 @@ describe("Page", () => {
|
||||
userEvent.type(query, faker.random.words());
|
||||
|
||||
await waitFor(
|
||||
() => expect(Router.push).not.toHaveBeenCalled(),
|
||||
() => {
|
||||
expect(Router.push).not.toHaveBeenCalled();
|
||||
expect(screen.queryByText(/loading translation/i)).not.toBeInTheDocument();
|
||||
},
|
||||
{ timeout: 250 }
|
||||
);
|
||||
await waitFor(
|
||||
() => expect(Router.push).toHaveBeenCalledTimes(1),
|
||||
() => {
|
||||
expect(Router.push).toHaveBeenCalledTimes(1);
|
||||
expect(screen.getByText(/loading translation/i)).toBeInTheDocument();
|
||||
},
|
||||
{ timeout: 2500 }
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user