Skip to content

Commit 0c0f18e

Browse files
test: integration for Followers list banner
1 parent 88a6013 commit 0c0f18e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/app/__tests__/page.test.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ describe("User Flow", () => {
3939
expect(mutualFollowerItem).not.toBeInTheDocument();
4040
});
4141

42+
// =================== //
43+
// Single File Uploads
44+
// =================== //
45+
4246
it("should display the Followers List Uploaded! banner when uploading a single proper followers.json file", async () => {
4347
// Assemble
4448
render(<Home></Home>);
@@ -55,8 +59,28 @@ describe("User Flow", () => {
5559
const followersListUploaded = await screen.findByText("Followers List Uploaded!");
5660
expect(followersListUploaded).toBeInTheDocument();
5761
});
62+
63+
// This is almost the exact same as the previous test cause well its almost the exact same process to check for the banner.
64+
it("should display the Followers List Uploaded! banner when uploading a single proper followers.json file", async () => {
65+
// Assemble
66+
render(<Home></Home>);
67+
const user = userEvent.setup();
68+
const following = new File([JSON.stringify(mockFollowing)], "following.json", {
69+
type: "application/json",
70+
});
71+
72+
// Act
73+
const fileInput = screen.getByTestId("file-input");
74+
await user.upload(fileInput, [following]);
75+
76+
// Assert
77+
const followingListUploaded = await screen.findByText("Following List Uploaded!");
78+
expect(followingListUploaded).toBeInTheDocument();
79+
});
5880
});
5981

82+
83+
6084
describe("Reset Button", () => {
6185
it("should return me back to the drop / default section when I hit the reset button", async () => {
6286
render(<Home></Home>);

0 commit comments

Comments
 (0)