All files / shared/utils isStartTimeChanged.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14        609x               91x  
import { isSameTime } from "shared/utils/timeComparison";
 
// A direct sign-up records the hour its attendee turns up, so a batched program item's parent
// time has no part in deciding whether that hour moved
export const isStartTimeChanged = (
  signedToStartTime: string,
  programItemStartTime: string,
): boolean =>
  // Reported as changed when either time is unparseable, which is what the
  // negation gives. A time that can't be read is not evidence that nothing moved,
  // and callers act on a change, so this is the answer that gets looked at rather
  // than silently passed over.
  !isSameTime(signedToStartTime, programItemStartTime);