-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(moderation): add More precise existing establishment -> CNRS res…
…ponse
- Loading branch information
1 parent
9242528
commit f1c453a
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...c/Actions/responses/__snapshots__/more_precise_existing_establishement_cnrs.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns more precise existing establishement - cnrs message 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Afin de donner suite à votre demande, merci de créer votre compte utilisateur ProConnect à nouveau, en le rattachant à l'organisation correspondant au nom de domaine de votre adresse e-mail « 🧿 » : | ||
LIBELLÉ DE L’ORGANISATION | ||
SIRET ORGANISATION | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...~/moderations/ui/src/Actions/responses/more_precise_existing_establishement_cnrs.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import more_precise_existing_establishement_cnrs from "./more_precise_existing_establishement_cnrs"; | ||
|
||
// | ||
|
||
test("returns more precise existing establishement - cnrs message", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
domain: "🧿", | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{more_precise_existing_establishement_cnrs()}</>; | ||
} |
30 changes: 30 additions & 0 deletions
30
...ages/~/moderations/ui/src/Actions/responses/more_precise_existing_establishement_cnrs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = | ||
"CNRS : Établissement plus précis existant —> CNRS - Cnrs moy1601 presidence"; | ||
|
||
export default function template() { | ||
const { | ||
domain, | ||
moderation: { | ||
organization: { cached_libelle: organization_name }, | ||
}, | ||
} = useContext(context); | ||
|
||
return dedent` | ||
Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Afin de donner suite à votre demande, merci de créer votre compte utilisateur ProConnect à nouveau, en le rattachant à l'organisation correspondant au nom de domaine de votre adresse e-mail « ${domain} » : | ||
LIBELLÉ DE L’ORGANISATION | ||
SIRET ORGANISATION | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |