Skip to content

Commit

Permalink
Merge pull request #1366 from City-of-Helsinki/HDS-2272-fix-koros
Browse files Browse the repository at this point in the history
Release-4.0.0 HDS-2272 fix koros examples, remova old and add new visual tests
  • Loading branch information
mrTuomoK authored Sep 20, 2024
2 parents e5ad4da + 67273dd commit 6c540cc
Show file tree
Hide file tree
Showing 83 changed files with 139 additions and 133 deletions.
12 changes: 12 additions & 0 deletions e2e/tests/core/components/core-koros-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { test } from '@playwright/test';
import { takeAllStorySnapshots } from '../../../helpers';

const componentName = 'koros';
const storybook = 'core';
const takeStateSnapshots = false;

test.describe(`Testing ${storybook} component "${componentName}"`, () => {
test('Take snapshots of all stories', async ({ page, isMobile }) => {
await takeAllStorySnapshots({ page, isMobile, takeStateSnapshots, storybook, componentName });
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions e2e/tests/react/components/react-koros-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { test } from '@playwright/test';
import { takeAllStorySnapshots } from '../../../helpers';

const componentName = 'koros';
const storybook = 'react';
const takeStateSnapshots = false;

test.describe(`Testing ${storybook} component "${componentName}"`, () => {
test('Take snapshots of all stories', async ({ page, isMobile }) => {
await takeAllStorySnapshots({ page, isMobile, takeStateSnapshots, storybook, componentName });
});
});
122 changes: 67 additions & 55 deletions packages/core/src/components/koros/koros.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export const Dense = () => `
<div class="hds-koros">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosPulseDense" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 10v75h32v-75c-8 0-8-10-16-10s-8 10-16 10z" />
<pattern id="korosPulseDense" x="0" y="0" width="32" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(1)" d="m0 10v75h32v-75c-8 0-8-10-16-10s-8 10-16 10z" />
</pattern>
</defs>
<rect fill="url(#korosPulseDense)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
<rect fill="url(#korosPulseDense)" width="100%" height="85" style="shape-rendering: crispedges;" />
</svg>
</div>
Expand Down Expand Up @@ -200,80 +200,92 @@ export const Flipped = () => `
`;

export const RotatedBasic45deg = () => `
<div class="hds-koros hds-koros--45deg" style="transform-origin: 43px">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic45deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic45deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--45deg" style="transform-origin: 43px">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic45deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic45deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

export const RotatedBasic90deg = () => `
<div class="hds-koros hds-koros--90deg" style="transform-origin: 43px">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic90deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic90deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--90deg" style="transform-origin: 43px">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic90deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic90deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

export const RotatedBasic135deg = () => `
<div class="hds-koros hds-koros--135deg" style="transform-origin: left; position: absolute; left: calc((100% / 1.4) + 43px);">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic135deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic135deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--135deg" style="transform-origin: left; position: absolute; left: calc((100% / 1.4) + 43px);">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic135deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic135deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

export const RotatedBasic225deg = () => `
<div class="hds-koros hds-koros--225deg" style="transform-origin: left; position: absolute; bottom: 0; left: calc((100% / 1.4) + 43px);">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic225deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic225deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
`;

export const RotatedBasic270deg = () => `
<div class="hds-koros hds-koros--270deg" style="transform-origin: calc(100% - 85px) 100%">
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--225deg" style="transform-origin: left; position: absolute; bottom: 0; left: calc((100% / 1.4) + 43px);">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic270deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<pattern id="korosBasic225deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic270deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
<rect fill="url(#korosBasic225deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

export const RotatedBasic270deg = () => `
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--270deg" style="transform-origin: calc(100% - 85px) 100%">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic270deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic270deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

export const RotatedBasic315deg = () => `
<div class="hds-koros hds-koros--315deg" style="transform-origin: bottom right;">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic315deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic315deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
<div style="min-height: 200px;">
<div class="hds-koros hds-koros--315deg" style="transform-origin: bottom right;">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="100%" height="85">
<defs>
<pattern id="korosBasic315deg" x="0" y="0" width="96" height="85" patternUnits="userSpaceOnUse">
<path transform="scale(3)" d="m0 5v80h32v-80c-8 0-8-5-16-5s-8 5-16 5z" />
</pattern>
</defs>
<rect fill="url(#korosBasic315deg)" width="100%" height="85" style="shapeRendering:'crispEdges'" />
</svg>
</div>
</div>
`;

Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion packages/react/.lokirc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"preset": "iPhone 7"
}
},
"skipStories": "Icons/.*|Button/*|Tag/*|Hero/*",
"skipStories": "Icons/.*|Button/*|Tag/*|Hero/*|Koros/*",
"pixelmatch": {
"threshold": 0.2,
"alpha": 1,
Expand Down
Loading

0 comments on commit 6c540cc

Please sign in to comment.