Skip to content

Commit

Permalink
test: add home page title tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed Feb 29, 2024
1 parent b9db467 commit 09c51cc
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/home/components/Home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,33 @@ test('Home: Display defaults', async () => {
)
).toBeInTheDocument();
});

test('Home: Display title', async () => {
fetchHomeData.mockReturnValue(
Promise.resolve({
groups: [],
landscapes: [],
})
);
await setup();
expect(screen.getByText(/First’s Terraso/i)).toBeInTheDocument();
});

test('Home: Display title (default)', async () => {
terrasoApi.requestGraphQL.mockReturnValue(
Promise.resolve(
_.set(
'users.edges[0].node',
{
firstName: undefined,
lastName: undefined,
profileImage: 'test.com',
preferences: { edges: [] },
},
{}
)
)
);
await setup();
expect(screen.getByText(/Terraso Home/i)).toBeInTheDocument();
});

0 comments on commit 09c51cc

Please sign in to comment.