mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
remove nesting options within options
This commit is contained in:
@@ -7,7 +7,7 @@ export const zodGlobalSettingsCourse = z.object({
|
|||||||
|
|
||||||
export const zodGlobalSettings = z.object({
|
export const zodGlobalSettings = z.object({
|
||||||
courses: z.array(zodGlobalSettingsCourse),
|
courses: z.array(zodGlobalSettingsCourse),
|
||||||
options: z.record(z.any()).optional(),
|
feedbackDelims: z.record(z.string()).optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,10 @@ describe("getFeedbackDelimitersFromSettings", () => {
|
|||||||
it("returns custom delimiters if options are present", () => {
|
it("returns custom delimiters if options are present", () => {
|
||||||
const settings: GlobalSettings = {
|
const settings: GlobalSettings = {
|
||||||
courses: [],
|
courses: [],
|
||||||
options: {
|
feedbackDelims: {
|
||||||
feedbackDelims: {
|
neutral: ":|",
|
||||||
neutral: ":|",
|
correct: ":)",
|
||||||
correct: ":)",
|
incorrect: ":(",
|
||||||
incorrect: ":(",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const expected = {
|
const expected = {
|
||||||
@@ -55,10 +53,8 @@ describe("getFeedbackDelimitersFromSettings", () => {
|
|||||||
it("returns mixed delimiters if some options are missing", () => {
|
it("returns mixed delimiters if some options are missing", () => {
|
||||||
const settings: GlobalSettings = {
|
const settings: GlobalSettings = {
|
||||||
courses: [],
|
courses: [],
|
||||||
options: {
|
feedbackDelims: {
|
||||||
feedbackDelims: {
|
correct: ":)",
|
||||||
correct: ":)",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const expected = {
|
const expected = {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const getFeedbackDelimitersFromSettings = (
|
|||||||
): FeedbackDelimiters => {
|
): FeedbackDelimiters => {
|
||||||
return overriddenDefaults(
|
return overriddenDefaults(
|
||||||
defaultFeedbackDelimiters,
|
defaultFeedbackDelimiters,
|
||||||
settings.options?.feedbackDelims ?? {} as Record<string, unknown>
|
settings.feedbackDelims ?? ({} as Record<string, unknown>)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user