Skip to content

Commit

Permalink
Adding unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-winn committed Jun 25, 2023
1 parent 648a69e commit 84f6b3d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/services/policies/mowerIsEnabledPolicy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ describe('DeterministicMowerIsScheduledPolicy', () => {
expect(target.check()).toBeFalsy();
});

it('should return true when the mower is scheduled to run but forced to mow', () => {
target.setMowerState({
activity: Activity.MOWING,
state: State.IN_OPERATION
});

target.setMowerSchedule({
runContinuously: false,
runInFuture: true,
runOnSchedule: true
});

const result = target.check();

expect(result).toBeTruthy();
});

it('should return true when run continuously and in operation', () => {
target.setMowerState({
activity: Activity.MOWING,
Expand Down

0 comments on commit 84f6b3d

Please sign in to comment.