Skip to content

Commit c6e675f

Browse files
committed
2 parents b357306 + a388128 commit c6e675f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import LoginConfirmationComponent from "@/components/LoginConfirmationComponent.vue";
2+
import { describe, expect, test } from "vitest";
3+
import type { User } from "../../types";
4+
import { userStore } from "../../stores/userStore";
5+
import { createPinia, setActivePinia } from "pinia";
6+
import { mount } from "@vue/test-utils";
7+
8+
describe("Given LoginConfirmationComponent", () => {
9+
expect(LoginConfirmationComponent).toBeTruthy();
10+
setActivePinia(createPinia());
11+
12+
test("Should display welcome message with storaged user data", () => {
13+
14+
const store = userStore();
15+
16+
const providedUser: User = {
17+
name: "valid_name",
18+
email: "valid_email",
19+
idToken: "valid_token",
20+
localId: "valid_localId",
21+
};
22+
23+
store.setUserAction(providedUser);
24+
25+
const wrapper = mount(LoginConfirmationComponent);
26+
const spanText = `${wrapper.find("span").text()}`;
27+
28+
expect(spanText).toEqual("Bem vindo, valid_email!");
29+
});
30+
});

0 commit comments

Comments
 (0)