diff --git a/packages/html-reporter/src/headerView.spec.tsx b/packages/html-reporter/src/headerView.spec.tsx index d276b57dbe..32112305c5 100644 --- a/packages/html-reporter/src/headerView.spec.tsx +++ b/packages/html-reporter/src/headerView.spec.tsx @@ -85,6 +85,16 @@ test('should show the project names', async ({ mount }) => { ); await expect(component.getByText('Project: my-project')).toBeVisible(); }); + await test.step('with 1 project and empty projectName', async () => { + const component = await mount( {}} + projectNames={['']} + > + ); + await expect(component.getByText('Project:')).toBeHidden(); + }); await test.step('with more than 1 project', async () => { const component = await mount( {reportLoaderError && {reportLoaderError}} - {projectNames.length === 1 && Project: {projectNames[0]}} + {projectNames.length === 1 && !!projectNames[0] && Project: {projectNames[0]}} Total time: {msToString(stats.duration)} >);