diff --git a/apps/website/e2e/homepage.spec.ts b/apps/website/e2e/homepage.spec.ts index 3797cd20eac..111c8ca5eeb 100644 --- a/apps/website/e2e/homepage.spec.ts +++ b/apps/website/e2e/homepage.spec.ts @@ -69,6 +69,50 @@ test.describe('Homepage @smoke', () => { ).toBeVisible() }) + test('CaseStudySpotlight CTA sizes to its content, not the column', async ({ + page + }) => { + const contentColumn = page.getByTestId('case-study-content') + const cta = contentColumn.getByRole('link', { + name: /see all case studies/i + }) + + await cta.scrollIntoViewIfNeeded() + await expect(cta).toBeVisible() + + const [columnBox, ctaBox] = await Promise.all([ + contentColumn.boundingBox(), + cta.boundingBox() + ]) + + expect(columnBox).not.toBeNull() + expect(ctaBox).not.toBeNull() + expect(ctaBox!.width).toBeLessThan(columnBox!.width * 0.7) + }) + + test('CaseStudySpotlight CTA has breathing room above it on mobile @mobile', async ({ + page + }) => { + const contentColumn = page.getByTestId('case-study-content') + const subheading = contentColumn.getByText( + /Videos & case studies from teams/i + ) + const cta = contentColumn.getByRole('link', { + name: /see all case studies/i + }) + + await cta.scrollIntoViewIfNeeded() + + const [subBox, ctaBox] = await Promise.all([ + subheading.boundingBox(), + cta.boundingBox() + ]) + + expect(subBox).not.toBeNull() + expect(ctaBox).not.toBeNull() + expect(ctaBox!.y - (subBox!.y + subBox!.height)).toBeGreaterThanOrEqual(24) + }) + test('BuildWhatSection is visible', async ({ page }) => { // "DOESN'T EXIST" is the actual badge text rendered in the Build What section await expect(page.getByText("DOESN'T EXIST")).toBeVisible() diff --git a/apps/website/src/components/home/CaseStudySpotlightSection.vue b/apps/website/src/components/home/CaseStudySpotlightSection.vue index 7dd46c9a4ad..9b033a19068 100644 --- a/apps/website/src/components/home/CaseStudySpotlightSection.vue +++ b/apps/website/src/components/home/CaseStudySpotlightSection.vue @@ -35,7 +35,10 @@ const routes = getRoutes(locale) -
+

-
- +
+ {{ t('caseStudy.seeAll', locale) }}