Skip to content
Snippets Groups Projects

Saving goal store

Merged Lotte Christine Walla Aune requested to merge savingGoal-store into development
5 files
+ 67
24
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -20,13 +20,8 @@ describe("Saving Goals Store", () => {
@@ -20,13 +20,8 @@ describe("Saving Goals Store", () => {
setActivePinia(createPinia());
setActivePinia(createPinia());
savingGoalsStore = useSavingGoalsStore();
savingGoalsStore = useSavingGoalsStore();
});
});
it("should have an empty list of saving goals", () => {
it("should have a default saving goal", () => {
expect(savingGoalsStore.savingGoals).toEqual([]);
expect(savingGoalsStore.currentSavingGoal).toEqual({
title: "Title",
goal: 0,
deadline: "2024-12-31",
});
});
});
it("should fetch saving goals and update store state", async () => {
it("should fetch saving goals and update store state", async () => {
@@ -41,4 +36,5 @@ describe("Saving Goals Store", () => {
@@ -41,4 +36,5 @@ describe("Saving Goals Store", () => {
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalled();
expect(axios.get).toHaveBeenCalledWith('/api/saving-goals/my-saving-goals');
expect(axios.get).toHaveBeenCalledWith('/api/saving-goals/my-saving-goals');
});
});
 
});
});
Loading