@openeuropa/bcl-subscription-block 0.24.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-subscription-block",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.26.0",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"description": "OE - BCL subscription block",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openeuropa/bcl-alert": "^0.
|
|
12
|
-
"@openeuropa/bcl-button": "^0.
|
|
13
|
-
"@openeuropa/bcl-form": "^0.
|
|
14
|
-
"@openeuropa/bcl-modal": "^0.
|
|
11
|
+
"@openeuropa/bcl-alert": "^0.26.0",
|
|
12
|
+
"@openeuropa/bcl-button": "^0.26.0",
|
|
13
|
+
"@openeuropa/bcl-form": "^0.26.0",
|
|
14
|
+
"@openeuropa/bcl-modal": "^0.26.0"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"design-system",
|
|
28
28
|
"twig"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "94d89cc379780cfce06178959194b3bc1b4c5eda"
|
|
31
31
|
}
|
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
{% set _content = content|default('') %}
|
|
12
12
|
{% set _button = button|default({}) %}
|
|
13
13
|
|
|
14
|
+
{% set _classes = ['bcl-subscription-block', 'bg-light', 'px-4-5', 'pt-4', 'pb-4-5'] %}
|
|
15
|
+
|
|
14
16
|
{% if attributes is empty %}
|
|
15
17
|
{% set attributes = create_attribute() %}
|
|
16
18
|
{% endif %}
|
|
17
19
|
|
|
18
|
-
{% set attributes = attributes.addClass(
|
|
20
|
+
{% set attributes = attributes.addClass(_classes) %}
|
|
19
21
|
|
|
20
22
|
<div
|
|
21
23
|
{{ attributes }}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { withDesign } from "storybook-addon-designs";
|
|
2
|
-
import withCode from "@openeuropa/storybook-addon-code";
|
|
3
|
-
|
|
4
2
|
import { correctPaths } from "@openeuropa/bcl-story-utils";
|
|
3
|
+
|
|
5
4
|
import subscriptionBlock from "@openeuropa/bcl-subscription-block/subscription-block.html.twig";
|
|
6
5
|
import demoData from "@openeuropa/bcl-subscription-block/data.js";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
8
|
title: "Compositions/Subscription Block",
|
|
10
|
-
decorators: [
|
|
9
|
+
decorators: [withDesign],
|
|
11
10
|
parameters: {
|
|
12
11
|
layout: "fullscreen",
|
|
13
12
|
controls: { disable: true },
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
renderTwigFileAsNode,
|
|
3
|
+
renderTwigFileAsHtml,
|
|
4
|
+
} from "@openeuropa/bcl-test-utils";
|
|
5
|
+
import { axe, toHaveNoViolations } from "jest-axe";
|
|
6
|
+
|
|
2
7
|
import demoData from "@openeuropa/bcl-subscription-block/data";
|
|
3
8
|
|
|
4
9
|
const template = "@oe-bcl/bcl-subscription-block/subscription-block.html.twig";
|
|
5
10
|
|
|
6
11
|
const render = (params) => renderTwigFileAsNode(template, params, true);
|
|
7
12
|
|
|
13
|
+
expect.extend(toHaveNoViolations);
|
|
14
|
+
|
|
8
15
|
describe("OE - Subscription Block", () => {
|
|
9
16
|
test("renders correctly", () => {
|
|
10
17
|
expect.assertions(1);
|
|
11
18
|
|
|
12
19
|
return expect(render(demoData)).resolves.toMatchSnapshot();
|
|
13
20
|
});
|
|
21
|
+
|
|
22
|
+
test(`passes the accessibility tests`, async () => {
|
|
23
|
+
expect(
|
|
24
|
+
await axe(renderTwigFileAsHtml(template, demoData, true))
|
|
25
|
+
).toHaveNoViolations();
|
|
26
|
+
});
|
|
14
27
|
});
|