|
1 |
| -import { addDays, subDays, subMonths, subWeeks } from "date-fns"; |
| 1 | +import { addDays, addWeeks, subDays, subMonths } from "date-fns"; |
2 | 2 | import { stubMutation, stubQuery } from "../utils/graphql";
|
3 | 3 |
|
4 | 4 | context("Actualisation Warning", () => {
|
@@ -118,23 +118,23 @@ context("Actualisation Warning", () => {
|
118 | 118 | name: "activity date is before threshold (5 months, 1 week and 6 days)",
|
119 | 119 | lastActivityDate: () => {
|
120 | 120 | const date = new Date();
|
121 |
| - return addDays(subWeeks(subMonths(date, 6), 2), 1).getTime(); |
| 121 | + return addDays(addWeeks(subMonths(date, 6), 2), 1).getTime(); |
122 | 122 | },
|
123 | 123 | shouldShowWarning: false,
|
124 | 124 | },
|
125 | 125 | {
|
126 | 126 | name: "activity date is exactly at threshold (5 months, 2 weeks)",
|
127 | 127 | lastActivityDate: () => {
|
128 | 128 | const date = new Date();
|
129 |
| - return subWeeks(subMonths(date, 6), 2).getTime(); |
| 129 | + return addWeeks(subMonths(date, 6), 2).getTime(); |
130 | 130 | },
|
131 | 131 | shouldShowWarning: true,
|
132 | 132 | },
|
133 | 133 | {
|
134 |
| - name: "activity date is after threshold (5 months, 2 weeks - 1 day)", |
| 134 | + name: "activity date is after threshold (5 months, 2 weeks and 1 day)", |
135 | 135 | lastActivityDate: () => {
|
136 | 136 | const date = new Date();
|
137 |
| - return subDays(subWeeks(subMonths(date, 6), 2), 1).getTime(); |
| 137 | + return subDays(addWeeks(subMonths(date, 6), 2), 1).getTime(); |
138 | 138 | },
|
139 | 139 | shouldShowWarning: true,
|
140 | 140 | },
|
|
0 commit comments