Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
eatski committed Aug 12, 2024
1 parent 1a2b9d6 commit fb0f9fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/app/stories/[storyId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getDevice } from "@/server/serverComponent/getDevice";
import { getUserSession } from "@/server/serverComponent/getUserSession";
import { setupABTestValue } from "@/server/serverComponent/setupABTestingVariant";
import { checkAnswer } from "@/server/services/answer";
import { askQuestio } from "@/server/services/question";
import { askQuestion } from "@/server/services/question";
import { verifyRecaptcha } from "@/server/services/recaptcha";
import { getStories, getStory } from "@/server/services/story";
import { deleteStory } from "@/server/services/story/deleteStory";
Expand Down Expand Up @@ -188,7 +188,7 @@ export default async function StoryPage({ params: { storyId } }: StoryProps) {
sendQuestion={async (input) => {
"use server";
await verifyRecaptcha(input.recaptchaToken);
return askQuestio(input.text, story, setupABTestValue());
return askQuestion(input.text, story, setupABTestValue());
}}
checkAnswer={async (input) => {
"use server";
Expand Down
14 changes: 7 additions & 7 deletions src/server/services/question/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, test } from "vitest";
import { askQuestio } from ".";
import { askQuestion } from ".";
import { AB_TESTING_VARIANTS } from "../../../common/abtesting";
import { parseYaml } from "../../../common/util/parseYaml";
import { applyTestHooks } from "../../../libs/msw-cache/vitest";
Expand Down Expand Up @@ -32,7 +32,7 @@ const loadStory = (storyYaml: string): Story => {
describe.each([
AB_TESTING_VARIANTS.ONLY_SONNET,
AB_TESTING_VARIANTS.GPT4O,
] as const)("service/question/askQuestio %s", (ab) => {
] as const)("service/question/askQuestion %s", (ab) => {
applyTestHooks();
const storyTamada = loadStory("test.yaml");
const storyHanako = loadStory("test2.yaml");
Expand Down Expand Up @@ -81,7 +81,7 @@ describe.each([
])(
"真相に対して正しい質問をするとTrueが返る $question",
async ({ question, story }) => {
const result = await askQuestio(question, story, Promise.resolve(ab));
const result = await askQuestion(question, story, Promise.resolve(ab));
expect(result.answer).toEqual("True");
},
);
Expand Down Expand Up @@ -129,7 +129,7 @@ describe.each([
])(
"真相に対して正しくない質問をするとFalseが返る $question",
async ({ question, story }) => {
const result = await askQuestio(question, story, Promise.resolve(ab));
const result = await askQuestion(question, story, Promise.resolve(ab));
expect(result.answer).toEqual("False");
},
);
Expand All @@ -153,7 +153,7 @@ describe.each([
])(
"真相では言及されていない質問をするとUnknownが返る $question",
async ({ question, story }) => {
const result = await askQuestio(question, story, Promise.resolve(ab));
const result = await askQuestion(question, story, Promise.resolve(ab));
expect(result.answer).toEqual("Unknown");
},
);
Expand Down Expand Up @@ -181,7 +181,7 @@ describe.each([
])(
"customMessageを持つquestionExamlpeに近しい質問をすると、customMessageが返る $question",
async ({ question, story, expected }) => {
const result = await askQuestio(question, story, Promise.resolve(ab));
const result = await askQuestion(question, story, Promise.resolve(ab));
expect(result.hitQuestionExample?.customMessage).toBe(expected);
},
);
Expand All @@ -193,7 +193,7 @@ describe.each([
])(
"customMessageを持つquestionExamlpeに近しくない質問をすると、customMessageが返らない",
async ({ question, story }) => {
const result = await askQuestio(question, story, Promise.resolve(ab));
const result = await askQuestion(question, story, Promise.resolve(ab));
expect(result.hitQuestionExample?.customMessage).not.toBeDefined();
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/server/services/question/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const abTestVarToQuestionToAI = {
[AB_TESTING_VARIANTS.GPT4O]: questionToAI,
} as const;

export const askQuestio = async (
export const askQuestion = async (
question: string,
story: Story,
abPromise: Promise<ABTestingVariant>,
Expand Down

0 comments on commit fb0f9fe

Please sign in to comment.