Skip to content

Commit 55e387f

Browse files
renovate[bot]znarf
andauthored
fix(deps): update dependency qrcode.react to v3.2.0 (#11726)
* fix(deps): update dependency qrcode.react to v3.2.0 * add regression test --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: François Hodierne <francois@hodierne.net>
1 parent 7601725 commit 55e387f

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import { render, screen, waitFor } from '@testing-library/react';
3+
import userEvent from '@testing-library/user-event';
4+
5+
import { withRequiredProviders } from '../../test/providers';
6+
7+
import { AuthenticatorSettings } from './AuthenticatorSettings';
8+
9+
describe('AuthenticatorSettings', () => {
10+
it('renders a QR code SVG when adding an authenticator', async () => {
11+
const user = userEvent.setup();
12+
render(
13+
withRequiredProviders(
14+
<AuthenticatorSettings
15+
userTwoFactorAuthenticationMethods={[]}
16+
individual={{ id: 'test-user', email: 'user@example.com' }}
17+
onRecoveryCodes={jest.fn()}
18+
/>,
19+
),
20+
);
21+
22+
await user.click(screen.getByRole('button', { name: /add authenticator/i }));
23+
24+
await waitFor(() => {
25+
expect(document.querySelector('[data-cy="qr-code"]')).not.toBeNull();
26+
});
27+
28+
const qrCodeElement = document.querySelector('[data-cy="qr-code"]');
29+
expect(qrCodeElement?.tagName.toLowerCase()).toBe('svg');
30+
expect(Number(qrCodeElement?.getAttribute('width'))).toBe(256);
31+
expect(Number(qrCodeElement?.getAttribute('height'))).toBe(256);
32+
});
33+
});

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"node-fetch": "^2.7.0",
105105
"nprogress": "0.2.0",
106106
"polished": "4.3.1",
107-
"qrcode.react": "3.1.0",
107+
"qrcode.react": "3.2.0",
108108
"react": "19.2.3",
109109
"react-animate-height": "3.2.3",
110110
"react-apexcharts": "1.7.0",

0 commit comments

Comments
 (0)