Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query pour la recherche Bsds dédiée à la fiche établissment #3694

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion back/src/__tests__/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ export const formFactory = async ({
...denormalizedSirets,
updatedAt: opt?.updatedAt ?? new Date()
},
include: { forwardedIn: true }
include: { forwardedIn: true, transporters: true }
});

return updated;
Expand Down
4 changes: 3 additions & 1 deletion back/src/bsds/resolvers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { QueryResolvers } from "../../generated/graphql/types";
import bsds from "./queries/bsds";
import { bsdResolver } from "./queries/bsd";
import { Mutation } from "./Mutation";
import controlBsdsResolver from "./queries/controlBsds";

const Query: QueryResolvers = {
bsds,
bsd: bsdResolver
bsd: bsdResolver,
controlBsds: controlBsdsResolver
};

export default { Query, Mutation };
5 changes: 2 additions & 3 deletions back/src/bsds/resolvers/queries/__tests__/bsds.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getFormForElastic, indexForm } from "../../../../forms/elastic";

import { faker } from "@faker-js/faker";

describe("query bsds: governement accoutns permissions", () => {
describe("query bsds: governement accounts permissions", () => {
afterEach(resetDatabase);

it("should allow user authenticated with a token when tied to a government account with relevant perms", async () => {
Expand Down Expand Up @@ -103,8 +103,7 @@ describe("query bsds: governement accoutns permissions", () => {
expect(errors[0].message).toEqual(`Vous n'êtes pas connecté.`);
});

it("should forbid user authenticated with a token if no gov government is associated", async () => {
// the company and owner to build a registry
it("should forbid user authenticated with a token if no government account is associated", async () => {
const { user: owner, company: someCompany } = await userWithCompanyFactory(
"MEMBER"
);
Expand Down
Loading
Loading