refactor: improve code formatting and readability in group duty pin command and tests
- Enhanced the `pin_duty_cmd` function by improving code formatting for better readability, ensuring consistent style across the codebase. - Updated unit tests for `pin_duty_cmd` to follow the same formatting improvements, enhancing clarity and maintainability. - No functional changes were made; the focus was solely on code style and organization.
This commit is contained in:
@@ -82,6 +82,33 @@ describe("getDutyMarkerRows", () => {
|
||||
expect(rows[0].timePrefix).toContain("06:00");
|
||||
});
|
||||
|
||||
it("second duty continuation from previous day shows only end time (to HH:MM)", () => {
|
||||
const hintDay = "2025-02-23";
|
||||
const duties = [
|
||||
{
|
||||
full_name: "A",
|
||||
start_at: "2025-02-23T00:00:00",
|
||||
end_at: "2025-02-23T09:00:00",
|
||||
},
|
||||
{
|
||||
full_name: "B",
|
||||
start_at: "2025-02-22T09:00:00",
|
||||
end_at: "2025-02-23T09:00:00",
|
||||
},
|
||||
];
|
||||
const rows = getDutyMarkerRows(duties, hintDay, SEP, FROM, TO);
|
||||
expect(rows).toHaveLength(2);
|
||||
expect(rows[0].fullName).toBe("A");
|
||||
expect(rows[0].timePrefix).toContain(FROM);
|
||||
expect(rows[0].timePrefix).toContain("00:00");
|
||||
expect(rows[0].timePrefix).toContain(TO);
|
||||
expect(rows[0].timePrefix).toContain("09:00");
|
||||
expect(rows[1].fullName).toBe("B");
|
||||
expect(rows[1].timePrefix).not.toContain(FROM);
|
||||
expect(rows[1].timePrefix).toContain(TO);
|
||||
expect(rows[1].timePrefix).toContain("09:00");
|
||||
});
|
||||
|
||||
it("multiple duties in one day — correct order when input is pre-sorted", () => {
|
||||
const hintDay = "2025-02-25";
|
||||
const duties = [
|
||||
|
||||
Reference in New Issue
Block a user