mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 11:04:27 +08:00
fix(web): crop ad banners from the right (ECO-467)
This commit is contained in:
parent
259fe7116e
commit
74bfab20a6
@ -61,6 +61,23 @@ describe('Marketplace home trending layout', () => {
|
||||
expect(adSlide.getBoundingClientRect().height).toBe(blogSlide.getBoundingClientRect().height)
|
||||
})
|
||||
|
||||
it('keeps the ad artwork left-aligned so responsive cropping stays on the right', async () => {
|
||||
await page.viewport(600, 900)
|
||||
const screen = await render(
|
||||
<div data-marketplace-standalone className="w-[560px]">
|
||||
<HomeBannerSlide banner={adBanner} isMarketplacePlatform page="plugins" />
|
||||
</div>,
|
||||
)
|
||||
|
||||
const artwork = screen
|
||||
.getByRole('link', { name: 'Partner campaign' })
|
||||
.element()
|
||||
.querySelector('img')
|
||||
|
||||
expect(artwork).not.toBeNull()
|
||||
expect(getComputedStyle(artwork!).objectPosition).toBe('0% 50%')
|
||||
})
|
||||
|
||||
it('keeps the blog artwork left corners rounded when its image is cropped', async () => {
|
||||
const screen = await render(
|
||||
<div className="w-[600px]">
|
||||
|
||||
@ -453,6 +453,7 @@ function ImageBannerSlide({
|
||||
alt=""
|
||||
aria-hidden
|
||||
className="size-full object-cover"
|
||||
style={{ objectPosition: banner.style_type === 'ad' ? 'left center' : undefined }}
|
||||
/>
|
||||
</picture>
|
||||
</Link>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user