Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TSLarson committed Sep 27, 2024
1 parent b5e2a7f commit 1d22712
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ exports[`SignUpPane shows the Captcha pane 1`] = `
/>
<CaptchaPane
error={false}
flow="signup"
i18n={
{
"html": [Function],
Expand Down Expand Up @@ -241,6 +242,7 @@ exports[`SignUpPane shows the Captcha pane for SSO (ADFS) connections 1`] = `
/>
<CaptchaPane
error={false}
flow="signup"
i18n={
{
"html": [Function],
Expand Down
10 changes: 6 additions & 4 deletions src/__tests__/engine/classic/sign_up_pane.test.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { expectComponent, mockComponent } from 'testUtils';
import { expectShallowComponent } from '../../testUtils';
import { Flow } from '../../../connection/captcha';

jest.mock('field/email/email_pane', () => mockComponent('email_pane'));
jest.mock('field/password/password_pane', () => mockComponent('password_pane'));
jest.mock('field/username/username_pane', () => mockComponent('username_pane'));
jest.mock('field/custom_input', () => mockComponent('custom_input'));

jest.mock('core/index', () => ({
captcha: jest.fn()
signupCaptcha: jest.fn()
}));

jest.mock('engine/classic', () => ({
Expand Down Expand Up @@ -38,6 +39,7 @@ describe('SignUpPane', () => {
str: (...keys) => keys.join(','),
html: (...keys) => keys.join(',')
},
flow: Flow.SIGNUP,
model: 'model',
emailInputPlaceholder: 'emailInputPlaceholder',
onlyEmail: true,
Expand All @@ -58,7 +60,7 @@ describe('SignUpPane', () => {
});

it('shows the Captcha pane', () => {
require('core/index').captcha.mockReturnValue({
require('core/index').signupCaptcha.mockReturnValue({
get() {
return true;
}
Expand All @@ -72,7 +74,7 @@ describe('SignUpPane', () => {
});

it('hides the Captcha pane for SSO connections', () => {
require('core/index').captcha.mockReturnValue({
require('core/index').signupCaptcha.mockReturnValue({
get() {
return true;
}
Expand All @@ -86,7 +88,7 @@ describe('SignUpPane', () => {
});

it('shows the Captcha pane for SSO (ADFS) connections', () => {
require('core/index').captcha.mockReturnValue({
require('core/index').signupCaptcha.mockReturnValue({
get() {
return true;
}
Expand Down

0 comments on commit 1d22712

Please sign in to comment.