mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-16 16:19:48 -05:00
added tests for whether registration modal shows up
This commit is contained in:
parent
c1b3efe572
commit
80ab13d32f
1 changed files with 35 additions and 0 deletions
|
@ -2,6 +2,7 @@ const React = require('react');
|
|||
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
||||
import configureStore from 'redux-mock-store';
|
||||
const Navigation = require('../../../src/components/navigation/www/navigation.jsx');
|
||||
const Registration = require('../../../src/components/registration/registration.jsx');
|
||||
const sessionActions = require('../../../src/redux/session.js');
|
||||
|
||||
describe('Navigation', () => {
|
||||
|
@ -24,6 +25,40 @@ describe('Navigation', () => {
|
|||
.dive(); // unwrap injectIntl(JoinFlow)
|
||||
};
|
||||
|
||||
test('when using old join flow, when registrationOpen is true, iframe shows', () => {
|
||||
store = mockStore({
|
||||
navigation: {
|
||||
registrationOpen: true,
|
||||
useScratch3Registration: false
|
||||
},
|
||||
session: {
|
||||
status: sessionActions.Status.FETCHED
|
||||
},
|
||||
messageCount: {
|
||||
messageCount: 0
|
||||
}
|
||||
});
|
||||
const navWrapper = getNavigationWrapper();
|
||||
expect(navWrapper.contains(<Registration />)).toEqual(true);
|
||||
});
|
||||
|
||||
test('when using new join flow, when registrationOpen is true, iframe does not show', () => {
|
||||
store = mockStore({
|
||||
navigation: {
|
||||
registrationOpen: true,
|
||||
useScratch3Registration: true
|
||||
},
|
||||
session: {
|
||||
status: sessionActions.Status.FETCHED
|
||||
},
|
||||
messageCount: {
|
||||
messageCount: 0
|
||||
}
|
||||
});
|
||||
const navWrapper = getNavigationWrapper();
|
||||
expect(navWrapper.contains(<Registration />)).toEqual(false);
|
||||
});
|
||||
|
||||
test('when using old join flow, clicking Join Scratch calls handleRegistrationRequested', () => {
|
||||
store = mockStore({
|
||||
navigation: {
|
||||
|
|
Loading…
Reference in a new issue