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:
parent
8e9864362b
commit
a68e1d8efb
2 changed files with 4 additions and 7 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in a new issue