Skip to content

Commit

Permalink
🤖🧹 reformat JavaScript files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
fbanados authored and github-actions[bot] committed Jan 20, 2025
1 parent d7a5c36 commit 1a7e084
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
24 changes: 12 additions & 12 deletions cypress/e2e/srseng/basics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import urls from "../../support/urls";

describe("The Tsúūt'ínà site", function () {
this.beforeEach(() => {
const cookies = Cypress.env('cookies') || []
cookies.forEach(c => cy.setCookie(c.name,c.value))
const cookies = Cypress.env("cookies") || [];
cookies.forEach((c) => cy.setCookie(c.name, c.value));
});

it("works", function () {
Expand All @@ -12,25 +12,25 @@ describe("The Tsúūt'ínà site", function () {
});

it("can login before anything", function () {
cy.user_login(`${urls.srseng}/accounts/login/?next=/`)
cy.getCookies().then(cookies => {
var values=""
cookies.forEach(c => values+=`{${c.name},${c.value}}`)
cy.user_login(`${urls.srseng}/accounts/login/?next=/`);
cy.getCookies().then((cookies) => {
var values = "";
cookies.forEach((c) => (values += `{${c.name},${c.value}}`));
Cypress.log({
name: "cookies",
message: `${values}`,
})
Cypress.env('cookies', cookies)
})
cy.visit(`${urls.srseng}`);
});
Cypress.env("cookies", cookies);
});
cy.visit(`${urls.srseng}`);
});

it("can search for a word", function () {
cy.visitSearch(`yidiskid`, urls.srseng).searchResultsContain("yídiskid");
cy.visitSearch(`yidiskid`, urls.srseng).searchResultsContain("yídiskid");
});

it("can display a paradigm", function () {
cy.visit(`${urls.srseng}/word/yídiskid`);
cy.get(".paradigm-cell").contains("mídiskid");
});
});
});
36 changes: 18 additions & 18 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Cypress.Commands.add(
});
return cy.visit(`${baseUrl}/search?q=${encodeURIComponent(searchQuery)}`, {
escapeComponents: false,
headers
headers,
});
}
);
Expand Down Expand Up @@ -144,25 +144,25 @@ Cypress.Commands.add("user_login", (url) => {
cy.get("@csrfToken").then(function (token) {
cy.request({
method: "POST",
url: url,
form: true,
body: {
username : "test_user",
password : "test",
next: "/",
csrfmiddlewaretoken: token,
},
headers: {
"X-CSRFTOKEN": token,
},
followRedirect: true,
}).then((response) => {
expect(response.status).to.eql(200);
cy.getCookies().then(cookies => {
Cypress.env('cookies', cookies)
})
url: url,
form: true,
body: {
username: "test_user",
password: "test",
next: "/",
csrfmiddlewaretoken: token,
},
headers: {
"X-CSRFTOKEN": token,
},
followRedirect: true,
}).then((response) => {
expect(response.status).to.eql(200);
cy.getCookies().then((cookies) => {
Cypress.env("cookies", cookies);
});
});
});
});

/**
Expand Down

0 comments on commit 1a7e084

Please sign in to comment.