Rollen Chunk 5: Genehmigungs-Status mit Eigen-UI
This commit is contained in:
1 parent
3352bba480
commit
3f4218f343
1 file changed
+44
@@ -12,6 +12,7 @@ test("renders overtime balance and remaining vacation", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 10,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 54,
|
||||
},
|
||||
}}
|
||||
@@ -33,6 +34,7 @@ test("warns when the remainder will not last the year", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 0,
|
||||
usedUnits: 56,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 4,
|
||||
},
|
||||
}}
|
||||
@@ -55,6 +57,7 @@ test("skips the projection for past years", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 0,
|
||||
usedUnits: 60,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 0,
|
||||
},
|
||||
}}
|
||||
@@ -74,6 +77,7 @@ test("warns before the carryover expires", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 10,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 54,
|
||||
},
|
||||
}}
|
||||
@@ -95,6 +99,7 @@ test("reports an expired carryover", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 10,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 54,
|
||||
},
|
||||
}}
|
||||
@@ -116,6 +121,7 @@ test("stays silent when the remainder is used up", () => {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 64,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 0,
|
||||
},
|
||||
}}
|
||||
@@ -124,3 +130,41 @@ test("stays silent when the remainder is used up", () => {
|
||||
);
|
||||
expect(screen.queryByText(/Übertrag \(/)).toBeNull();
|
||||
});
|
||||
|
||||
test("zeigt beantragte Tage nur bei Bedarf", () => {
|
||||
const { rerender } = render(
|
||||
<Dashboard
|
||||
overview={{
|
||||
year: 2026,
|
||||
overtimeMinutes: 150,
|
||||
vacation: {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 10,
|
||||
pendingUnits: 0,
|
||||
remainingUnits: 54,
|
||||
},
|
||||
}}
|
||||
now={new Date("2026-10-04T12:00:00Z")}
|
||||
/>,
|
||||
);
|
||||
expect(screen.queryByText(/Beantragt/)).toBeNull();
|
||||
rerender(
|
||||
<Dashboard
|
||||
overview={{
|
||||
year: 2026,
|
||||
overtimeMinutes: 150,
|
||||
vacation: {
|
||||
entitlementUnits: 60,
|
||||
carryoverUnits: 4,
|
||||
usedUnits: 10,
|
||||
pendingUnits: 4,
|
||||
remainingUnits: 54,
|
||||
},
|
||||
}}
|
||||
now={new Date("2026-10-04T12:00:00Z")}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByText("Beantragt:")).toBeInTheDocument();
|
||||
expect(screen.getByText("2 Tage")).toBeInTheDocument();
|
||||
});
|
||||
Reference in new issue
Block a user