Skip to content

Commit

Permalink
Merge adb7811 into 34fd1cd
Browse files Browse the repository at this point in the history
  • Loading branch information
willemliufdmg committed Jan 9, 2024
2 parents 34fd1cd + adb7811 commit 1e09ff0
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 654 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1745,8 +1745,8 @@ import { Modal } from '@fdmg/design-system/components/modal/Modal';
function Foo() {
return (
<Modal opened={true} onClose={() => {}>
<>
<Modal opened={true} onClose={() => {}}>
<section className="xs_p+4">
<h2>Abonnement wijzigen of opzeggen</h2>
<p>
Voor wijzigingen kunt u elk moment bellen. Voor
Expand All @@ -1763,7 +1763,8 @@ function Foo() {
Ook kijken we graag samen met u naar een
abonnementsvorm die wellicht beter bij u past.
</p>
</>
<ButtonCta className="close">Sluiten</ButtonCta>
</section>
</Modal>
);
}
Expand Down
49 changes: 0 additions & 49 deletions __tests__/components/Modal.test.tsx

This file was deleted.

12 changes: 4 additions & 8 deletions __tests__/components/ab/Experiment.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,21 @@ describe('AB Experiment', () => {
// Assert we are in variant 1
expect(getByText('Headline 1')).toBeTruthy();
// Assert debug button is rendered
expect(document.querySelectorAll('h2').length).toEqual(1);
expect(document.querySelectorAll('h2').length).toEqual(2);
// Click on debug button
fireEvent.click(getByText('A/B Test experiment', { exact: false }));
// Assert debug modal is rendered
expect(getByText('Test experiment')).toBeTruthy();
expect(
document.querySelectorAll('.debug-modal-content h2').length
).toEqual(1);
expect(document.querySelectorAll('.debug-modal h2').length).toEqual(2);
expect(getByTitle('Remove experiment cookie')).toBeTruthy();
fireEvent.click(getByTitle('Remove experiment cookie'));

// Click variant 2 in debug modal
fireEvent.click(document.querySelectorAll('label')[1]);

// Close debug modal
fireEvent.click(
document.querySelector('.debug-modal-content h2 span')!
);
expect(document.querySelectorAll('h2').length).toEqual(1);
fireEvent.click(document.querySelector('.debug-modal h2 span')!);
expect(document.querySelectorAll('h2').length).toEqual(2);

// Assert we are in variant 2
expect(getByText('Headline 2')).toBeTruthy();
Expand Down
32 changes: 32 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ module.exports = {
},
];
},
headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: "default-src http: https: data: blob: ws: wss: 'unsafe-inline' 'unsafe-eval';"
.replace(/\s{2,}/g, ' ')
.trim(),
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
{
key: 'strict-transport-security',
value: 'max-age=15724800',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
],
},
];
},
webpack: (config, options) => {
// Markdown
config.module.rules.push({
Expand Down

0 comments on commit 1e09ff0

Please sign in to comment.