Skip to content

Commit

Permalink
fix(recherche-entreprise): suppression du paramètre employer=true q…
Browse files Browse the repository at this point in the history
…ui bug (#5770)
  • Loading branch information
maxgfr authored Apr 9, 2024
1 parent 3a4f2eb commit 00fcf85
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/code-du-travail-frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import htmlvalidate from "cypress-html-validate/plugin";
dotenv.config();

module.exports = defineConfig({
defaultCommandTimeout: 10000, // 10s
defaultCommandTimeout: 20000, // 20s
e2e: {
baseUrl: process.env.TEST_BASEURL ?? "http://localhost:3000",
specPattern: process.env.ALL_TEST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(404);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=NOT-FOUND&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=NOT-FOUND&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand All @@ -38,7 +38,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
"https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=La%20p%C3%AAche%20%C3%A0%20la%20ligne&convention=false&employer=true&open=true&matchingLimit=0",
"https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=La%20p%C3%AAche%20%C3%A0%20la%20ligne&convention=false&open=true&matchingLimit=0",
{ headers: { referer: "cdtn-api" } }
);
});
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand All @@ -121,7 +121,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
"https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=hello&convention=false&employer=true&open=true&matchingLimit=0&address=my%20address",
"https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=hello&convention=false&open=true&matchingLimit=0&address=my%20address",
{ headers: { referer: "cdtn-api" } }
);
});
Expand Down Expand Up @@ -151,7 +151,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -190,7 +190,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -254,7 +254,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -284,7 +284,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -323,7 +323,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -373,7 +373,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -421,7 +421,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -469,7 +469,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down Expand Up @@ -524,7 +524,7 @@ describe("Test enterprise endpoint", () => {
expect(response.status).toEqual(200);
expect(fetch).toHaveBeenCalledTimes(1);
expect(fetch).toHaveBeenCalledWith(
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&employer=true&open=true&matchingLimit=0`,
`https://api.recherche-entreprises.fabrique.social.gouv.fr/api/v1/search?ranked=true&query=AUTOEXPRESS&convention=false&open=true&matchingLimit=0`,
{ headers: { referer: "cdtn-api" } }
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const fetchEnterprises = async (
{ k: "ranked", v: "true" },
{ k: "query", v: encodeURIComponent(query) },
{ k: "convention", v: "false" },
{ k: "employer", v: "true" },
{ k: "open", v: "true" },
{ k: "matchingLimit", v: "0" },
];
Expand Down

0 comments on commit 00fcf85

Please sign in to comment.