diff --git a/src/home/components/Home.js b/src/home/components/Home.js index 598cbd345..21af0b929 100644 --- a/src/home/components/Home.js +++ b/src/home/components/Home.js @@ -93,7 +93,13 @@ const Home = () => { return ( - + diff --git a/src/home/components/Home.test.js b/src/home/components/Home.test.js index 6995d22ee..7e34a843a 100644 --- a/src/home/components/Home.test.js +++ b/src/home/components/Home.test.js @@ -29,16 +29,15 @@ jest.mock('home/homeService', () => ({ fetchHomeData: jest.fn(), })); -const setup = async () => { +const setup = async ( + currentUserData = { firstName: 'First', lastName: 'Last' } +) => { await render(, { account: { hasToken: true, currentUser: { fetching: false, - data: { - firstName: 'First', - lastName: 'Last', - }, + data: currentUserData, }, }, }); @@ -249,3 +248,25 @@ 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 () => { + fetchHomeData.mockReturnValue( + Promise.resolve({ + groups: [], + landscapes: [], + }) + ); + await setup({ firstName: undefined, lastName: undefined }); + expect(screen.getByText(/Terraso Home/i)).toBeInTheDocument(); +}); diff --git a/src/tool/components/ToolCard.js b/src/tool/components/ToolCard.js index db2efea5d..68f44eb41 100644 --- a/src/tool/components/ToolCard.js +++ b/src/tool/components/ToolCard.js @@ -153,7 +153,11 @@ const ToolCard = ({ tool }) => {
- +