Portal: 12-hour schedule times and dynamicAudio default on
Use TimeInput for Block start/end and show the day timeline axis with AM/PM, so no 24-hour time is displayed in the schedule UI. New Blocks now default dynamicAudio to true in the modal and server-side when the field is absent; existing stored Blocks are untouched.
This commit is contained in:
@@ -90,7 +90,7 @@ describe('createBlock', () => {
|
||||
scheduleId: 's1',
|
||||
startMinutes: validInput.startMinutes,
|
||||
endMinutes: validInput.endMinutes,
|
||||
dynamicAudio: false,
|
||||
dynamicAudio: true,
|
||||
proclamations: {
|
||||
create: [
|
||||
{ proclamationId: 'p1', sortOrder: 0 },
|
||||
@@ -101,6 +101,32 @@ describe('createBlock', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('defaults dynamic audio on when the field is absent', async () => {
|
||||
blockFindMany.mockResolvedValue([]);
|
||||
blockCreate.mockResolvedValue({ id: 'new-block' });
|
||||
|
||||
await createBlock('u1', validInput);
|
||||
|
||||
expect(blockCreate).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ dynamicAudio: true })
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('persists dynamic audio off when the field is explicitly false', async () => {
|
||||
blockFindMany.mockResolvedValue([]);
|
||||
blockCreate.mockResolvedValue({ id: 'new-block' });
|
||||
|
||||
await createBlock('u1', { ...validInput, dynamicAudio: false });
|
||||
|
||||
expect(blockCreate).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
data: expect.objectContaining({ dynamicAudio: false })
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('persists the dynamic audio flag', async () => {
|
||||
blockFindMany.mockResolvedValue([]);
|
||||
blockCreate.mockResolvedValue({ id: 'new-block' });
|
||||
@@ -168,7 +194,7 @@ describe('updateBlock', () => {
|
||||
data: {
|
||||
startMinutes: validInput.startMinutes,
|
||||
endMinutes: validInput.endMinutes,
|
||||
dynamicAudio: false,
|
||||
dynamicAudio: true,
|
||||
proclamations: {
|
||||
deleteMany: {},
|
||||
create: [{ proclamationId: 'p1', sortOrder: 0 }]
|
||||
|
||||
Reference in New Issue
Block a user