diff --git a/packages/component-library-pdf/README.md b/packages/component-library-pdf/README.md index 6e64f32912..dbc226f31c 100644 --- a/packages/component-library-pdf/README.md +++ b/packages/component-library-pdf/README.md @@ -25,6 +25,7 @@ Bekijk elke test in `*.test.tsx`. Bekijk het PDF document dat correspondeert met - [Tagged PDF Best Practice Guide: Syntax For developers implementing ISO 14289-1 (PDF/UA) — PDF download](https://pdfa.org/wp-content/uploads/2019/06/TaggedPDFBestPracticeGuideSyntax.pdf) - [Deterministic output: a way to specify the PDF File Identifier (/ID) property](https://www.princexml.com/forum/topic/4931/deterministic-output-a-way-to-specify-the-pdf-file?p=1#24826) +- [Convert PDF to HTML](https://pdfix.io/convert-pdf-to-html/). Gebruik de optie "Layout defined by PDF Tags" om te zien welke tags er in een PDF zitten, via de developer tools. Bijvoorbeeld: `data-pdf-se-type-original="Link"`. ## PDF/UA-1 in vergelijking met design system components diff --git a/packages/component-library-pdf/package.json b/packages/component-library-pdf/package.json index 3486147783..5e53ed5a82 100644 --- a/packages/component-library-pdf/package.json +++ b/packages/component-library-pdf/package.json @@ -20,6 +20,7 @@ "clean": "rimraf dist/", "build": "tsx src/index.tsx", "install-prince": "( cd node_modules/prince && npm run install )", + "lint-build": "tsc --noEmit --project tsconfig.json", "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "test:watch": "jest --watch" }, diff --git a/packages/component-library-pdf/src/Article.test.tsx b/packages/component-library-pdf/src/Article.test.tsx new file mode 100644 index 0000000000..76f8f6475e --- /dev/null +++ b/packages/component-library-pdf/src/Article.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Article, Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Article', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-article', + render: () => ( +
+ The quick brown fox jumps over the lazy dog +
+ ), + }); + + expect(sha256).toBe('3a94e1e570c85d3c0d1c35589b65a6f1a690e8c581bed5a217d4713abc2d1dac'); + }); +}); diff --git a/packages/component-library-pdf/src/Blockquote.test.tsx b/packages/component-library-pdf/src/Blockquote.test.tsx new file mode 100644 index 0000000000..932ad2c9c3 --- /dev/null +++ b/packages/component-library-pdf/src/Blockquote.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Blockquote, Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Blockquote', () => { + it('renders a
tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-blockquote', + render: () => ( +
+ The quick brown fox jumps over the lazy dog. +
+ ), + }); + + expect(sha256).toBe('1565b0f7dd9ae4121654f76836cba952321e1d3110c7a910f2563d18a664eda8'); + }); +}); diff --git a/packages/component-library-pdf/src/Checkbox.test.tsx b/packages/component-library-pdf/src/Checkbox.test.tsx new file mode 100644 index 0000000000..b84198cf39 --- /dev/null +++ b/packages/component-library-pdf/src/Checkbox.test.tsx @@ -0,0 +1,17 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Checkbox } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Checkbox', () => { + it('renders a
tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-checkbox', + render: () => , + }); + + expect(sha256).toBe('16860207ce8377c3b11bd31d676efba22d10f8eedacdf9098b702c2743fc512b'); + }); +}); diff --git a/packages/component-library-pdf/src/Code.test.tsx b/packages/component-library-pdf/src/Code.test.tsx new file mode 100644 index 0000000000..5239d4c527 --- /dev/null +++ b/packages/component-library-pdf/src/Code.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Code, Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Code', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-code', + render: () => ( + + Use {'/* Hello world */'} to create a code comment. + + ), + }); + + expect(sha256).toBe('f8104c20620bcf4c4e9a63f83c88d32841fef9f6ec481fb3de238d97997d134a'); + }); +}); diff --git a/packages/component-library-pdf/src/CodeBlock.test.tsx b/packages/component-library-pdf/src/CodeBlock.test.tsx new file mode 100644 index 0000000000..151c6c7caf --- /dev/null +++ b/packages/component-library-pdf/src/CodeBlock.test.tsx @@ -0,0 +1,28 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { CodeBlock } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Code block', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-code-block', + render: () => ( + {` + + + NL Design System + + + +

NL Design System

+ +`}
+ ), + }); + + expect(sha256).toBe('46986780cbaeba8d2b585dc2d244f68a273121c8e831f1dba10912c968cfc0a8'); + }); +}); diff --git a/packages/component-library-pdf/src/DataList.test.tsx b/packages/component-library-pdf/src/DataList.test.tsx new file mode 100644 index 0000000000..c4b37d2f3e --- /dev/null +++ b/packages/component-library-pdf/src/DataList.test.tsx @@ -0,0 +1,42 @@ +/* eslint-env jest */ + +import { beforeAll, describe, expect, it } from '@jest/globals'; +import { DataList, DataListItem, DataListKey, DataListValue } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Data list', () => { + let sha256: string; + + beforeAll(async () => { + ({ sha256 } = await renderPdf({ + id: 'pdf-data-list', + render: () => ( + + + Pangram + The quick brown fox jumps over the lazy dog + + + ), + })); + }); + + it('renders a tag', async () => { + expect(sha256).toBe('1ef37478b0c027f45c557c94ca9c4d237860baf121f02d482e45b85c43348134'); + }); + + describe('list item', () => { + it('renders a
  • tag', async () => { + expect(sha256).toBe('1ef37478b0c027f45c557c94ca9c4d237860baf121f02d482e45b85c43348134'); + }); + + it('renders a tag with the key', async () => { + expect(sha256).toBe('1ef37478b0c027f45c557c94ca9c4d237860baf121f02d482e45b85c43348134'); + }); + + it('renders a tag with the value', async () => { + expect(sha256).toBe('1ef37478b0c027f45c557c94ca9c4d237860baf121f02d482e45b85c43348134'); + }); + }); +}); diff --git a/packages/component-library-pdf/src/FormFieldTextbox.test.tsx b/packages/component-library-pdf/src/FormFieldTextbox.test.tsx new file mode 100644 index 0000000000..b2c688596d --- /dev/null +++ b/packages/component-library-pdf/src/FormFieldTextbox.test.tsx @@ -0,0 +1,22 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { FormFieldTextbox } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Form field with textbox', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-form-field-textbox', + render: () => ( + + ), + }); + + expect(sha256).toBe('d79ea42074650594beb4266345e09cabeb9a437ed13d66ac6f40527b715ec62b'); + }); +}); diff --git a/packages/component-library-pdf/src/FormLabel.test.tsx b/packages/component-library-pdf/src/FormLabel.test.tsx new file mode 100644 index 0000000000..3ab74f9975 --- /dev/null +++ b/packages/component-library-pdf/src/FormLabel.test.tsx @@ -0,0 +1,17 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { FormLabel } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Form label', () => { + it.skip('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-form-label', + render: () => Name, + }); + + expect(sha256).toBe(''); + }); +}); diff --git a/packages/component-library-pdf/src/Heading.test.tsx b/packages/component-library-pdf/src/Heading.test.tsx index 26648f5ddc..e88d1ccf9a 100644 --- a/packages/component-library-pdf/src/Heading.test.tsx +++ b/packages/component-library-pdf/src/Heading.test.tsx @@ -14,7 +14,7 @@ import React from 'react'; import { renderPdf } from './lib'; describe('Heading with variable heading level', () => { - it('renders a tag', async () => { + it.skip('renders a tag', async () => { const { sha256 } = await renderPdf({ id: 'pdf-heading', render: () => ( @@ -32,6 +32,6 @@ describe('Heading with variable heading level', () => { ), }); - expect(sha256).toBe('90df84a649e31187a33eebdbbe0136ed8ffcf3ac872f4d29d77c4a3053f1f5fb'); + expect(sha256).toBe(''); }); }); diff --git a/packages/component-library-pdf/src/Heading1.test.tsx b/packages/component-library-pdf/src/Heading1.test.tsx index 10ed6d8db4..5fd1fabe66 100644 --- a/packages/component-library-pdf/src/Heading1.test.tsx +++ b/packages/component-library-pdf/src/Heading1.test.tsx @@ -12,6 +12,6 @@ describe('Heading 1', () => { render: () => Heading 1: The quick brown fox jumps over the lazy dog, }); - expect(sha256).toBe('8fe3ac6c1c0d81bffa47c0ba01ca001dbc303126f2d9340d948ce15883456922'); + expect(sha256).toBe('f7922ee3cbbe73b7aff8b2532aedacb6a254f2b673591b360b6656154a18b6ba'); }); }); diff --git a/packages/component-library-pdf/src/Heading2.test.tsx b/packages/component-library-pdf/src/Heading2.test.tsx index 8c9eb78079..23ae00ebc6 100644 --- a/packages/component-library-pdf/src/Heading2.test.tsx +++ b/packages/component-library-pdf/src/Heading2.test.tsx @@ -17,6 +17,6 @@ describe('Heading 2', () => { ), }); - expect(sha256).toBe('47e2b852ce5c3ac5a44d87e5becae04e5d7b55aaf6c0240163640115a6d08683'); + expect(sha256).toBe('8facfd10a62f642565c95c1c69575d3cbc81f841c9a69fc230ec5d2e85410c4d'); }); }); diff --git a/packages/component-library-pdf/src/Heading3.test.tsx b/packages/component-library-pdf/src/Heading3.test.tsx index 4f30435932..654cf8aa72 100644 --- a/packages/component-library-pdf/src/Heading3.test.tsx +++ b/packages/component-library-pdf/src/Heading3.test.tsx @@ -18,6 +18,6 @@ describe('Heading 3', () => { ), }); - expect(sha256).toBe('c9ec84295cdd4b5a7d1c444e1524ebda9d93d7f1e55d503bc5d0cf68c06c9053'); + expect(sha256).toBe('dce041d710cc1e2b14f842806fd198b9ace85b34b92ed439ff2b54c9843e18a9'); }); }); diff --git a/packages/component-library-pdf/src/Heading4.test.tsx b/packages/component-library-pdf/src/Heading4.test.tsx index 83a71327b3..4221b9dff5 100644 --- a/packages/component-library-pdf/src/Heading4.test.tsx +++ b/packages/component-library-pdf/src/Heading4.test.tsx @@ -19,6 +19,6 @@ describe('Heading 4', () => { ), }); - expect(sha256).toBe('8e28b82b0d3926a2b5c9c66491360de191469141013cf9ee31556663095690e3'); + expect(sha256).toBe('16f18aaec4180ddb54c99066f125298f980dfd00fc3ef9d0113d094fd27498eb'); }); }); diff --git a/packages/component-library-pdf/src/Heading5.test.tsx b/packages/component-library-pdf/src/Heading5.test.tsx index 0cbbf0479c..9a1b3baf46 100644 --- a/packages/component-library-pdf/src/Heading5.test.tsx +++ b/packages/component-library-pdf/src/Heading5.test.tsx @@ -20,6 +20,6 @@ describe('Heading 5', () => { ), }); - expect(sha256).toBe('19dc5443153516d489baac2e16823b291d80a65f0e2b4b683dac2f7d0734c389'); + expect(sha256).toBe('0cc780670d80a4579ac73d6d61a026f9fec1d1a6e2fc0876068e6c26cce84df2'); }); }); diff --git a/packages/component-library-pdf/src/Heading6.test.tsx b/packages/component-library-pdf/src/Heading6.test.tsx index b8ad40879e..4cc7dd5ab6 100644 --- a/packages/component-library-pdf/src/Heading6.test.tsx +++ b/packages/component-library-pdf/src/Heading6.test.tsx @@ -21,6 +21,6 @@ describe('Heading 6', () => { ), }); - expect(sha256).toBe('bfb75d4176247439d0aa9101c664552d20af3e0ae6126046367ad5c8390543d1'); + expect(sha256).toBe('518e7313d993ccc7e6b9f922aac4cc87ea31afaafe8a5740df0bdfab7196bff0'); }); }); diff --git a/packages/component-library-pdf/src/LangSpan.test.tsx b/packages/component-library-pdf/src/LangSpan.test.tsx new file mode 100644 index 0000000000..4e02917f0d --- /dev/null +++ b/packages/component-library-pdf/src/LangSpan.test.tsx @@ -0,0 +1,29 @@ +/* eslint-env jest */ + +import { beforeAll, describe, expect, it } from '@jest/globals'; +import { Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Language span', () => { + let sha256: string; + + beforeAll(async () => { + ({ sha256 } = await renderPdf({ + id: 'pdf-span-lang', + render: () => ( + + Learn about joi de vivre, an essential foreign phrase! + + ), + })); + }); + + it('renders a tag', async () => { + expect(sha256).toBe('99db074fa02bc374efb1b74f388c93627100b0048e04dd986e003ab0ae88ea92'); + }); + + it('renders a tag with the language set to French', async () => { + expect(sha256).toBe('99db074fa02bc374efb1b74f388c93627100b0048e04dd986e003ab0ae88ea92'); + }); +}); diff --git a/packages/component-library-pdf/src/Link.test.tsx b/packages/component-library-pdf/src/Link.test.tsx new file mode 100644 index 0000000000..438bf1261f --- /dev/null +++ b/packages/component-library-pdf/src/Link.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Link, Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Link', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-link', + render: () => ( + + Go to example.com. + + ), + }); + + expect(sha256).toBe('cfb53b1c5cdc2d5efc4b2cc2c933bfb8ef8d9fee0ec9ce7c2897f080189c9369'); + }); +}); diff --git a/packages/component-library-pdf/src/OrderedList.test.tsx b/packages/component-library-pdf/src/OrderedList.test.tsx index 204105c469..3ada34b36f 100644 --- a/packages/component-library-pdf/src/OrderedList.test.tsx +++ b/packages/component-library-pdf/src/OrderedList.test.tsx @@ -1,36 +1,39 @@ /* eslint-env jest */ -import { describe, expect, it } from '@jest/globals'; +import { beforeAll, describe, expect, it } from '@jest/globals'; import { OrderedList, OrderedListItem } from '@utrecht/component-library-react'; import React from 'react'; import { renderPdf } from './lib'; describe('Ordered list', () => { - it('renders a tag', async () => { - const { sha256 } = await renderPdf({ + let sha256: string; + + beforeAll(async () => { + ({ sha256 } = await renderPdf({ id: 'pdf-ordered-list', render: () => ( The quick brown fox jumps over the lazy dog ), - }); + })); + }); - expect(sha256).toBe('07fc6915a511ebf3fe9116a57bf6b5fc1bb3c597402a54a9c4a6f328453a6312'); + it('renders a tag', async () => { + expect(sha256).toBe('051ffdb077ac93f772bd55f208bcf86a9c18d8c80da2e17ebba37665d7e1bdf6'); }); describe('list item', () => { it('renders a
  • tag', async () => { - const { sha256 } = await renderPdf({ - id: 'pdf-ordered-list-item', - render: () => ( - - The quick brown fox jumps over the lazy dog - - ), - }); + expect(sha256).toBe('051ffdb077ac93f772bd55f208bcf86a9c18d8c80da2e17ebba37665d7e1bdf6'); + }); + + it('renders a tag with list item counter', async () => { + expect(sha256).toBe('051ffdb077ac93f772bd55f208bcf86a9c18d8c80da2e17ebba37665d7e1bdf6'); + }); - expect(sha256).toBe('61b4a7f5c904a9fc98cecf5da39fa9dde37ada56d9a1a3fbda46c1a275fdd8e2'); + it('renders a tag with the text content', async () => { + expect(sha256).toBe('051ffdb077ac93f772bd55f208bcf86a9c18d8c80da2e17ebba37665d7e1bdf6'); }); }); }); diff --git a/packages/component-library-pdf/src/Page.test.tsx b/packages/component-library-pdf/src/Page.test.tsx index f699e015a0..12e95bbfbc 100644 --- a/packages/component-library-pdf/src/Page.test.tsx +++ b/packages/component-library-pdf/src/Page.test.tsx @@ -14,7 +14,7 @@ describe('Page', () => { lang: 'en', }); - expect(sha256).toBe('84f693ca7ace1abef94f154a024c3a8a40b9bb6eaa8b635c6941b0a33db3991e'); + expect(sha256).toBe('31e87dc3502014e56f8b59e9b7ecc33a326906aac457e14e022023a06d222b9e'); }); it('can be configured to Dutch', async () => { @@ -24,6 +24,6 @@ describe('Page', () => { lang: 'nl', }); - expect(sha256).toBe('89e84ee346ad0f25ae8206c085e6a5189915d49f5abb7621f32f5d9dcbba759b'); + expect(sha256).toBe('ab1213ac7be61428181ff69098273abce52adbaf75c1f2c00619360b1a49a8d2'); }); }); diff --git a/packages/component-library-pdf/src/Paragraph.test.tsx b/packages/component-library-pdf/src/Paragraph.test.tsx index 1a689d68b3..3005e8644a 100644 --- a/packages/component-library-pdf/src/Paragraph.test.tsx +++ b/packages/component-library-pdf/src/Paragraph.test.tsx @@ -12,7 +12,7 @@ describe('Paragraph', () => { render: () => The quick brown fox jumps over the lazy dog., }); - expect(sha256).toBe('fc5887a255f97781b7b3b7bb781bcbfdbd459e608ead98b3da6c7a5722171968'); + expect(sha256).toBe('47cf64f54c0d84db46429c50a46a25524c4e9bc3805bbe0a7d5442d1380f6776'); }); describe('paragraph with alternate language', () => { @@ -22,7 +22,7 @@ describe('Paragraph', () => { render: () => {'Portez ce vieux whisky au juge blond qui fume'}, }); - expect(sha256).toBe('0d9d30b844175893ad921568e6172927d37d1b9b09b5060a9edfc996990e9867'); + expect(sha256).toBe('03d4ec73c4ee2d80042114abf6971f4a600f9eb75f90c822a8cbf642d1d7259f'); }); }); @@ -37,7 +37,7 @@ describe('Paragraph', () => { ), }); - expect(sha256).toBe('f83ac633f31da41b3c2ad814f194fcd73fbd4886ffa8256e8e14c5645c0333ab'); + expect(sha256).toBe('2f8ba7b0a61e97fcb3105f7ac6e6d5e2b215d40b7e33086758e570c9f4b119f5'); }); }); @@ -48,11 +48,11 @@ describe('Paragraph', () => { render: () => {'The quick brown fox jumps over the lazy dog. '.repeat(100)}, }); - expect(sha256).toBe('4232f8a6d3e5beb2d313627a886485d921c72ddbb53f640a554eeadac3b0d980'); + expect(sha256).toBe('29f5807ffd4cd97dc533b5f8d67ef9f349bc2e954c9330ea6c292de657696601'); }); }); - describe('empty paragraph for visual space', () => { + describe.skip('empty paragraph for visual space', () => { it('PDF ideally contains only two paragraph tags, but an additional tag for the empty paragraph typically is not counted as violation.', async () => { const { sha256 } = await renderPdf({ id: 'pdf-paragraph-empty', @@ -65,7 +65,7 @@ describe('Paragraph', () => { ), }); - expect(sha256).toBe('46f1063b84ff374e691fc24c49c9c3d420b81ee4d6ddac1b3c986e2466894c5a'); + expect(sha256).toBe(''); }); }); }); diff --git a/packages/component-library-pdf/src/Quote.test.tsx b/packages/component-library-pdf/src/Quote.test.tsx new file mode 100644 index 0000000000..31da2d8fce --- /dev/null +++ b/packages/component-library-pdf/src/Quote.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Quote', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-quote', + render: () => ( + + The quick brown fox jumps over the lazy dog. + + ), + }); + + expect(sha256).toBe('010c106d03fb3d51fe37e09b54fc21a3a72149e92f8a3cf3d51f6c4836169fe2'); + }); +}); diff --git a/packages/component-library-pdf/src/RadioButton.test.tsx b/packages/component-library-pdf/src/RadioButton.test.tsx new file mode 100644 index 0000000000..c7e787dd7a --- /dev/null +++ b/packages/component-library-pdf/src/RadioButton.test.tsx @@ -0,0 +1,29 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { RadioButton } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Radio button', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-radio-button', + render: () => ( + <> +

    + +

    +

    + +

    +

    + +

    + + ), + }); + + expect(sha256).toBe('c0224e85c479415e7a9ff9470f93731b03434a92ce63cc973af4b9a933be2af6'); + }); +}); diff --git a/packages/component-library-pdf/src/Section.test.tsx b/packages/component-library-pdf/src/Section.test.tsx new file mode 100644 index 0000000000..e55b379928 --- /dev/null +++ b/packages/component-library-pdf/src/Section.test.tsx @@ -0,0 +1,21 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Paragraph } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Section', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-section', + render: () => ( +
    + The quick brown fox jumps over the lazy dog +
    + ), + }); + + expect(sha256).toBe('7810a4401a93ea0583e6be662f363d27028fb6025c4ab830ef75dec5e6e01d77'); + }); +}); diff --git a/packages/component-library-pdf/src/Table.test.tsx b/packages/component-library-pdf/src/Table.test.tsx index 497c40a473..fd2c11d0aa 100644 --- a/packages/component-library-pdf/src/Table.test.tsx +++ b/packages/component-library-pdf/src/Table.test.tsx @@ -29,13 +29,13 @@ describe('Table', () => { ), }); - expect(sha256).toBe('6b796f4e85e73d90902e1adc9c88a9d86f074a079d83714c71b7d6b34b9276fc'); + expect(sha256).toBe('633d92ad73af2a8a42520e0dc89cb2cf57dce5700d73ed66d599f8b175e953bb'); }); - describe('table heading', () => { + describe('table header', () => { it('renders a tag', async () => { const { sha256 } = await renderPdf({ - id: 'pdf-table-heading', + id: 'pdf-table-header', render: () => ( @@ -52,7 +52,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('80676d6a5151ffa17beb010e37d5f962d4f384428a52a9811fc3311c467b71ca'); + expect(sha256).toBe('ab64dcafa4bb9efde9bad1756e1276dbc4169f5544be3fa6239935fb0747810e'); }); }); @@ -71,7 +71,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('efe368356d95294a871c61f4e37744a4b5490dd7bb0bda9e5e5b31704e4baf5b'); + expect(sha256).toBe('19143779e8962bfc81c496c4f741a878b7b86f6cb24d7cdc251e4106cfbfbedf'); }); }); @@ -95,7 +95,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('63738d7089d989f444e5e46eedbec90c14033a65e3af9f8457be1ec10bf1516b'); + expect(sha256).toBe('3082bd8a19ebccc9959e255db4d1606dd097feff3bd2942512fdf8b168180b94'); }); }); @@ -115,7 +115,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('3319415490adb394fe5a88330606205de4ae36242fa921a7254ab5aac621934c'); + expect(sha256).toBe('fafc2f6803f2a497b54521349377ba0dbe94a35187c250ac1cbe19f1cbd49baf'); }); }); @@ -134,7 +134,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('16ad045ad95c355d7ebdfa34ebaf10e07b6beba70e4e6f10faf24baae2708932'); + expect(sha256).toBe('3737811c7f420d180d5c79bff2420298cda6a524e8ea1e07653108f24b22094e'); }); }); @@ -158,10 +158,10 @@ describe('Table', () => { ), }); - expect(sha256).toBe('40c4f943fbb1435b2aeeb58085a4f6a5486e8813ba85e5b5bccd101fa6a246c3'); + expect(sha256).toBe('6603b39a7c853b1787bc88e869110120da986e7d918d9c9ea4f575cf4d8cf6da'); }); - describe('empty cells are always
    cells, never cells.', () => { + describe.skip('empty cells are always cells, never cells.', () => { it('renders a tag', async () => { const { sha256 } = await renderPdf({ id: 'pdf-table-heading-cell-empty', @@ -190,7 +190,7 @@ describe('Table', () => { ), }); - expect(sha256).toBe('7ec99755f7fa7f7a00b1e3ff140b6aa2c999c8de45827180b55d3c5e8ba3c985'); + expect(sha256).toBe(''); }); }); }); diff --git a/packages/component-library-pdf/src/Textarea.test.tsx b/packages/component-library-pdf/src/Textarea.test.tsx new file mode 100644 index 0000000000..8d9dea4b05 --- /dev/null +++ b/packages/component-library-pdf/src/Textarea.test.tsx @@ -0,0 +1,17 @@ +/* eslint-env jest */ + +import { describe, expect, it } from '@jest/globals'; +import { Textarea } from '@utrecht/component-library-react'; +import React from 'react'; +import { renderPdf } from './lib'; + +describe('Textarea', () => { + it('renders a tag', async () => { + const { sha256 } = await renderPdf({ + id: 'pdf-textarea', + render: () =>