We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d05ab0 commit 8ad16e0Copy full SHA for 8ad16e0
src/utils/campaigns/types.test.ts
@@ -52,5 +52,13 @@ describe("Campaigns", () => {
52
53
expect(actual).toBe(expected);
54
});
55
+
56
+ it("should return false for vaccine with no campaign", () => {
57
+ const campaigns = Campaigns.fromJson(jsonString)!;
58
59
+ const active = campaigns.isActive(VaccineType.FLU_FOR_CHILDREN);
60
61
+ expect(active).toBe(false);
62
+ });
63
64
src/utils/campaigns/types.ts
@@ -57,7 +57,7 @@ export class Campaigns {
/** Get all campaigns for a specific vaccine */
get(vaccine: VaccineType): Campaign[] {
- return this.schedule[vaccine] ?? [];
+ return this.schedule[vaccine] || [];
}
/** Check if a vaccine is currently active */
0 commit comments