mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
moving v2 to top level
This commit is contained in:
31
src/models/local/tests/testHolidayParsing.test.ts
Normal file
31
src/models/local/tests/testHolidayParsing.test.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { parseHolidays } from "../utils/settingsUtils";
|
||||
|
||||
describe("can parse holiday string", () => {
|
||||
it("can parse empty list", () => {
|
||||
const testString = `
|
||||
springBreak:
|
||||
`;
|
||||
const output = parseHolidays(testString);
|
||||
expect(output).toEqual([{ name: "springBreak", days: [] }]);
|
||||
});
|
||||
it("can parse list with date", () => {
|
||||
const testString = `
|
||||
springBreak:
|
||||
- 10/12/2024
|
||||
`;
|
||||
const output = parseHolidays(testString);
|
||||
expect(output).toEqual([{ name: "springBreak", days: ["10/12/2024"] }]);
|
||||
});
|
||||
it("can parse list with two dates", () => {
|
||||
const testString = `
|
||||
springBreak:
|
||||
- 10/12/2024
|
||||
- 10/13/2024
|
||||
`;
|
||||
const output = parseHolidays(testString);
|
||||
expect(output).toEqual([
|
||||
{ name: "springBreak", days: ["10/12/2024", "10/13/2024"] },
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user