Skip to content

Commit

Permalink
update rejection reason test
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Nov 28, 2023
1 parent fbf51c4 commit 64ac1dc
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ it("can copy comment embed code", async () => {
window.prompt = jsdomPrompt;
});

it("requires rection reason when dsaFeaturesEnabled", async () => {
it("requires rejection reason when dsaFeaturesEnabled", async () => {
await act(async () => {
await createTestRenderer({
resolvers: createResolversStub<GQLResolver>({
Expand All @@ -659,6 +659,7 @@ it("requires rection reason when dsaFeaturesEnabled", async () => {
reason: {
code: "OTHER",
detailedExplanation: "really weird comment tbh",
customReason: "custom reason",
},
});
return {
Expand Down Expand Up @@ -719,6 +720,17 @@ it("requires rection reason when dsaFeaturesEnabled", async () => {
});
});

expect(submitReasonButton).toBeDisabled();

const customReason =
within(reasonModal).getByPlaceholderText("Add your reason");

act(() => {
fireEvent.change(customReason, {
target: { value: "custom reason" },
});
});

expect(submitReasonButton).toBeEnabled();

act(() => {
Expand Down

0 comments on commit 64ac1dc

Please sign in to comment.