Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
660 changes: 239 additions & 421 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@cfaester/enzyme-adapter-react-18": "^0.8.0",
"@google-cloud/translate": "^9.1.0",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/auth0-js": "^9.21.6",
"babel-jest": "^29.3.1",
"babel-loader": "8.4.1",
Expand All @@ -78,7 +80,6 @@
"cross-env": "^7.0.3",
"css-loader": "^7.1.2",
"emojic": "^1.1.17",
"enzyme": "^3.1.1",
"es-check": "^6.0.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
Expand Down Expand Up @@ -109,7 +110,6 @@
"mocha": "^11.5.0",
"prettier": "^2.4.1",
"puppeteer": "^24.9.0",
"react-test-renderer": "^18.2.0",
"sinon": "^1.15.4",
"stylus": "^0.64.0",
"stylus-loader": "^3.0.2",
Expand All @@ -132,8 +132,8 @@
"password-sheriff": "^2.0.0",
"prop-types": "^15.8.0",
"qs": "^6.14.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.2.0 || ^19.0.0",
"react-dom": "^18.2.0 || ^19.0.0",
"react-transition-group": "^4.4.5",
"url-join": "^1.1.0",
"validator": "^13.15.22"
Expand All @@ -158,7 +158,7 @@
"<rootDir>/src/",
"<rootDir>/src/__tests__"
],
"setupFiles": [
"setupFilesAfterEnv": [
"<rootDir>/src/__tests__/setup-tests.js"
],
"coveragePathIgnorePatterns": [
Expand Down
77 changes: 31 additions & 46 deletions src/__tests__/__snapshots__/auth_button.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,55 +1,40 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`AuthButton renders correctly 1`] = `
<a
className="auth0-lock-social-button auth0-lock-social-big-button"
data-provider="strategy"
onClick={[MockFunction]}
style={{}}
type="button"
>
<div
className="auth0-lock-social-button-icon"
style={{}}
/>
<div
className="auth0-lock-social-button-text"
style={{}}
<DocumentFragment>
<a
class="auth0-lock-social-button auth0-lock-social-big-button"
data-provider="strategy"
type="button"
>
label
</div>
</a>
<div
class="auth0-lock-social-button-icon"
/>
<div
class="auth0-lock-social-button-text"
>
label
</div>
</a>
</DocumentFragment>
`;

exports[`AuthButton renders with style customizations 1`] = `
<a
className="auth0-lock-social-button auth0-lock-social-big-button"
data-provider="strategy"
onClick={[MockFunction]}
style={
{
"backgroundColor": "primaryColor",
}
}
type="button"
>
<div
className="auth0-lock-social-button-icon"
style={
{
"backgroundImage": "url('test')",
}
}
/>
<div
className="auth0-lock-social-button-text"
style={
{
"color": "foregroundColor",
}
}
<DocumentFragment>
<a
class="auth0-lock-social-button auth0-lock-social-big-button"
data-provider="strategy"
type="button"
>
label
</div>
</a>
<div
class="auth0-lock-social-button-icon"
style="background-image: url("test");"
/>
<div
class="auth0-lock-social-button-text"
>
label
</div>
</a>
</DocumentFragment>
`;
9 changes: 5 additions & 4 deletions src/__tests__/auth_button.test.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { mount } from 'enzyme';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { expectComponent } from 'testUtils';

Expand All @@ -24,9 +25,9 @@ describe('AuthButton', () => {
/>
).toMatchSnapshot();
});
it('should trigger onClick when clicked', () => {
const wrapper = mount(<AuthButton {...defaultProps} />);
wrapper.find('a').simulate('click');
it('should trigger onClick when clicked', async () => {
const { container } = render(<AuthButton {...defaultProps} />);
await userEvent.click(container.querySelector('a'));
expect(defaultProps.onClick.mock.calls.length).toBe(1);
});
});
Loading