diff --git a/src/home/components/Home.test.js b/src/home/components/Home.test.js index 6995d22ee..95308f84f 100644 --- a/src/home/components/Home.test.js +++ b/src/home/components/Home.test.js @@ -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(); +});