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:
@@ -21,7 +21,8 @@ it("changes all fields", () => {
|
||||
target: faker.random.locale(),
|
||||
query,
|
||||
delayedQuery: query,
|
||||
translation: faker.random.words()
|
||||
translation: faker.random.words(),
|
||||
isLoading: faker.datatype.boolean()
|
||||
};
|
||||
|
||||
const res = langReducer(initialState, {
|
||||
@@ -46,7 +47,8 @@ it("switches the languages & the translations", () => {
|
||||
target: state.source,
|
||||
query: state.translation,
|
||||
delayedQuery: state.translation,
|
||||
translation: ""
|
||||
translation: "",
|
||||
isLoading: initialState.isLoading
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ describe("googleScrape", () => {
|
||||
});
|
||||
|
||||
it("returns correct message on request error", async () => {
|
||||
const status = faker.random.number({ min: 400, max: 499 });
|
||||
const status = faker.datatype.number({ min: 400, max: 499 });
|
||||
resolveFetchWith({ status });
|
||||
|
||||
const res = await googleScrape(source, target, query);
|
||||
@@ -61,7 +61,7 @@ describe("extractSlug", () => {
|
||||
it("returns empty object on 0 or >4 params", () => {
|
||||
expect(extractSlug([])).toStrictEqual({});
|
||||
|
||||
const length = faker.random.number({ min: 4, max: 50 });
|
||||
const length = faker.datatype.number({ min: 4, max: 50 });
|
||||
const array = Array(length).fill("");
|
||||
expect(extractSlug(array)).toStrictEqual({});
|
||||
});
|
||||
@@ -74,7 +74,7 @@ describe("textToSpeechScrape", () => {
|
||||
});
|
||||
|
||||
it("returns 'null' on request error", async () => {
|
||||
const status = faker.random.number({ min: 400, max: 499 });
|
||||
const status = faker.datatype.number({ min: 400, max: 499 });
|
||||
resolveFetchWith({ status });
|
||||
expect(await textToSpeechScrape(target, query)).toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user