-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bal-carousel): fix card sliding issue (#1100)
* fix(bal-carousel): fix card sliding issue * chore(): add visual test * chore(): format * chore(): fix the mobile version * chore(): improve visual tests * chore(): update base images --------- Co-authored-by: mladenplaninicic <[email protected]>
- Loading branch information
1 parent
c0b3eac
commit 669c63f
Showing
23 changed files
with
244 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@baloise/design-system-components': patch | ||
--- | ||
|
||
Correct sliding width issue in card carousel for consistent display |
205 changes: 205 additions & 0 deletions
205
packages/components/src/components/bal-carousel/test/bal-carousel.visual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
<!DOCTYPE html> | ||
<html dir="ltr" lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
|
||
<link rel="stylesheet" href="/assets/baloise-design-system.css" /> | ||
<script type="module" src="/build/design-system-components.esm.js"></script> | ||
<script nomodule src="/build/design-system-components.js"></script> | ||
</head> | ||
|
||
<body> | ||
<bal-app class="bal-body"> | ||
<main class="container is-compact py-medium"> | ||
<section> | ||
<bal-carousel data-testid="basic" border> | ||
<bal-carousel-item> | ||
<div class="has-background-green-1 p-normal is-fullwidth">AAA</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="has-background-green-2 p-normal is-fullwidth">BBB</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="has-background-green-3 p-normal is-fullwidth">CCC</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="has-background-green-4 p-normal is-fullwidth">DDD</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="has-background-green-5 p-normal has-text-white is-fullwidth">EEE</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="has-background-green-6 p-normal has-text-white is-fullwidth">FFF</div> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
|
||
<section class="my-normal"> | ||
<bal-carousel data-testid="image" interface="image" controls="dots" border> | ||
<bal-carousel-item | ||
src="https://fastly.picsum.photos/id/626/1280/720.jpg?hmac=pHWhzQeCr1Zq8_NquZJ51qZ0xXa4psCZpoeJbaUbkWM" | ||
> | ||
</bal-carousel-item> | ||
<bal-carousel-item | ||
src="https://fastly.picsum.photos/id/921/1280/720.jpg?hmac=_kfenyYI38K4FYrzavn01cZUPqpu1pbn2OYNhrGqwvg" | ||
> | ||
</bal-carousel-item> | ||
<bal-carousel-item | ||
src="https://fastly.picsum.photos/id/235/1280/720.jpg?hmac=MBlYf-BNbNbdxmF-qCtt9eNsT1SKJy_1JCHeLDRHYEw" | ||
> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
|
||
<section class="my-normal"> | ||
<bal-carousel | ||
data-testid="product" | ||
interface="product" | ||
steps="2" | ||
items-per-view="auto" | ||
controls="large" | ||
border | ||
> | ||
<bal-carousel-item color="green" label="0 Auto" src="/assets/images/brand/car.svg"></bal-carousel-item> | ||
<bal-carousel-item | ||
color="yellow" | ||
label="1 Haushalt" | ||
src="/assets/images/brand/lamp.svg" | ||
></bal-carousel-item> | ||
<bal-carousel-item | ||
color="purple" | ||
label="2 Hypothek" | ||
src="/assets/images/brand/home.svg" | ||
></bal-carousel-item> | ||
<bal-carousel-item color="red" label="3 Pensionsplanung" src="/assets/images/brand/bars.svg"> | ||
</bal-carousel-item> | ||
<bal-carousel-item color="green" label="4 Anlegen" src="/assets/images/brand/plant.svg"></bal-carousel-item> | ||
<bal-carousel-item | ||
color="yellow" | ||
label="5 Finanzplanung Finanzplanung Finanzplanung Finanzplanung Finanzplanung" | ||
src="/assets/images/brand/pie.svg" | ||
></bal-carousel-item> | ||
<bal-carousel-item color="purple" label="6 E-Banking" src="/assets/images/brand/notebook.svg"> | ||
</bal-carousel-item> | ||
<bal-carousel-item color="red" label="7 Sparen" src="/assets/images/brand/pig.svg"></bal-carousel-item> | ||
<bal-carousel-item color="green" label="8 YouGo" src="/assets/images/brand/diamond.svg"></bal-carousel-item> | ||
<bal-carousel-item color="yellow" label="9 Alle Gegenstände" src="/assets/images/brand/items.svg"> | ||
</bal-carousel-item> | ||
<bal-carousel-item color="purple" label="10 Motorrad & Roller" src="/assets/images/brand/roller.svg"> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
|
||
<section class="my-normal"> | ||
<bal-carousel data-testid="card" interface="card" controls="tabs" controls-sticky border> | ||
<bal-carousel-item label="ECO"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title ECO</bal-card-title> | ||
<bal-card-content>Content Content Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
<bal-carousel-item label="SMART"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title SMART</bal-card-title> | ||
<bal-card-content>Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
<bal-carousel-item label="TOP"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title TOP</bal-card-title> | ||
<bal-card-content>Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
|
||
<section class="my-normal"> | ||
<bal-carousel data-testid="card-with-value" interface="card" controls="tabs" controls-sticky border value="1"> | ||
<bal-carousel-item label="ECO"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title ECO</bal-card-title> | ||
<bal-card-content>Content Content Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
<bal-carousel-item label="SMART"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title SMART</bal-card-title> | ||
<bal-card-content>Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
<bal-carousel-item label="TOP"> | ||
<bal-card style="width: 100%"> | ||
<bal-card-title>Title TOP</bal-card-title> | ||
<bal-card-content>Content</bal-card-content> | ||
</bal-card> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
|
||
<section class="my-normal"> | ||
<bal-carousel data-testid="responsive" items-per-view="auto" steps="3" controls="small" border> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">First Liverpool</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Valencia</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Madrid</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Barcelona</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">München</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Manchester</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">London</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Basel</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Brüssel</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Paris</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Berlin</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Hamburg</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Stuttgart</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Bern</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Zürich</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Dornach</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Reinach</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-2">Olten</div> | ||
</bal-carousel-item> | ||
<bal-carousel-item> | ||
<div class="px-x-small has-background-green-1">Solothurn Last</div> | ||
</bal-carousel-item> | ||
</bal-carousel> | ||
</section> | ||
</main> | ||
</bal-app> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
describe('bal-carousel', () => { | ||
beforeEach(() => cy.visit('/components/bal-carousel/test/bal-carousel.visual.html').waitForDesignSystem()) | ||
|
||
it('basic component', () => { | ||
cy.platform('desktop') | ||
cy.getByTestId('basic').compareSnapshot('carousel-basic-desktop') | ||
cy.getByTestId('image').compareSnapshot('carousel-image-desktop') | ||
cy.getByTestId('product').compareSnapshot('carousel-product-desktop') | ||
cy.getByTestId('card').compareSnapshot('carousel-card-desktop') | ||
cy.getByTestId('card-with-value').compareSnapshot('carousel-card-with-value-desktop') | ||
cy.getByTestId('responsive').compareSnapshot('carousel-responsive-desktop') | ||
|
||
cy.platform('tablet') | ||
cy.getByTestId('basic').compareSnapshot('carousel-basic-tablet') | ||
cy.getByTestId('image').compareSnapshot('carousel-image-tablet') | ||
cy.getByTestId('product').compareSnapshot('carousel-product-tablet') | ||
cy.getByTestId('card').compareSnapshot('carousel-card-tablet') | ||
cy.getByTestId('card-with-value').compareSnapshot('carousel-card-with-value-tablet') | ||
cy.getByTestId('responsive').compareSnapshot('carousel-responsive-tablet') | ||
|
||
cy.platform('mobile') | ||
cy.getByTestId('basic').compareSnapshot('carousel-basic-mobile') | ||
cy.getByTestId('image').compareSnapshot('carousel-image-mobile') | ||
cy.getByTestId('product').compareSnapshot('carousel-product-mobile') | ||
cy.getByTestId('card').compareSnapshot('carousel-card-mobile') | ||
cy.getByTestId('card-with-value').compareSnapshot('carousel-card-with-value-mobile') | ||
cy.getByTestId('responsive').compareSnapshot('carousel-responsive-mobile') | ||
}) | ||
}) |
Binary file added
BIN
+1.38 KB
...ress/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-basic-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.25 KB
...press/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-basic-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.36 KB
...press/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-basic-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.2 KB
...press/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-card-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
...ypress/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-card-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.7 KB
...ypress/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-card-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.1 KB
...hots/base/visual/bal-carousel.visual.cy.ts/carousel-card-with-value-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
...shots/base/visual/bal-carousel.visual.cy.ts/carousel-card-with-value-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.4 KB
...shots/base/visual/bal-carousel.visual.cy.ts/carousel-card-with-value-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+419 KB
...ress/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-image-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+106 KB
...press/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-image-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+333 KB
...press/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-image-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.3 KB
...ss/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-product-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.5 KB
...ess/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-product-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.2 KB
...ess/snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-product-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-responsive-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.67 KB
.../snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-responsive-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
.../snapshots/base/visual/bal-carousel.visual.cy.ts/carousel-responsive-tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.