fix(e2e): target chrome title slot so subtitle does not collide

Desktop chrome put title+subtitle in one text node; exact getByText
failed. Mobile subtitle matched Municípios case-insensitively. Mark the
title with data-slot and assert against that node.
This commit is contained in:
Cursor Agent 2026-08-02 20:14:58 +00:00
parent 8e9864362b
commit a68e1d8efb
No known key found for this signature in database
2 changed files with 4 additions and 7 deletions

View file

@ -16,7 +16,7 @@ export const CampaignPageChromeText = ({
data-slot="campaign-page-chrome"
className={cn('min-w-0 truncate text-sm font-medium text-foreground', className)}
>
{chrome.title}
<span data-slot="campaign-page-chrome-title">{chrome.title}</span>
{chrome.subtitle ? (
<span className="font-normal text-muted-foreground"> {chrome.subtitle}</span>
) : null}
@ -26,7 +26,9 @@ export const CampaignPageChromeText = ({
return (
<div data-slot="campaign-page-chrome" className={cn('min-w-0 flex-1 leading-tight', className)}>
<span className="block truncate text-sm font-semibold">{chrome.title}</span>
<span data-slot="campaign-page-chrome-title" className="block truncate text-sm font-semibold">
{chrome.title}
</span>
{chrome.subtitle ? (
<span className="block truncate text-xs text-primary-foreground/80">{chrome.subtitle}</span>
) : null}

View file

@ -565,11 +565,6 @@ export const campaignPageChrome = (page: Page, title: string) =>
page
.locator('[data-slot="campaign-page-chrome"]')
.filter({ visible: true })
<<<<<<< HEAD
.getByText(title)
.first()
=======
.getByText(title, { exact: true })
>>>>>>> ce710645 (fix(e2e): exact match in campaignPageChrome for mobile subtitles)
export { expect }