Added translator cleanup on logo click (#11)

This commit is contained in:
David
2021-04-08 22:28:45 +02:00
committed by GitHub
parent ea8c1bad57
commit a80c177440
3 changed files with 19 additions and 7 deletions

View File

@@ -72,6 +72,7 @@ it("switches first loaded page and back and forth on language change", () => {
cy.visit(`/auto/en/${query}`);
cy.findByRole("textbox", { name: /translation query/i })
.as("query")
.should("have.value", query);
cy.findByRole("combobox", { name: /source language/i })
.as("source")
@@ -82,6 +83,12 @@ it("switches first loaded page and back and forth on language change", () => {
.select("auto")
.url()
.should("include", `/auto/en/${encodeURIComponent(query)}`);
cy.findByRole("link", { name: /logo/i })
.click()
.url()
.should("not.include", "/auto/en")
.get("@query")
.should("be.empty");
});
it("language switching button is disabled on 'auto', but enables when other", () => {