From 1a7e0842d864d23e86db851d79b5fff40fca65ea Mon Sep 17 00:00:00 2001 From: fbanados <248151+fbanados@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:43:57 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=F0=9F=A7=B9=20reformat=20JavaScrip?= =?UTF-8?q?t=20files=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/srseng/basics.spec.js | 24 ++++++++++----------- cypress/support/commands.js | 36 +++++++++++++++---------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/cypress/e2e/srseng/basics.spec.js b/cypress/e2e/srseng/basics.spec.js index 797892bfd..78826fdee 100644 --- a/cypress/e2e/srseng/basics.spec.js +++ b/cypress/e2e/srseng/basics.spec.js @@ -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 () { @@ -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"); - }); + }); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index dedce79e8..d84e1a546 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -39,7 +39,7 @@ Cypress.Commands.add( }); return cy.visit(`${baseUrl}/search?q=${encodeURIComponent(searchQuery)}`, { escapeComponents: false, - headers + headers, }); } ); @@ -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); }); }); + }); }); /**