Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
68fc4fe4
Commit
68fc4fe4
authored
Nov 05, 2019
by
picklesrus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge conflicts :(
parent
c77db390
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
53 deletions
+9
-53
src/components/join-flow/email-step.jsx
src/components/join-flow/email-step.jsx
+0
-8
src/components/join-flow/join-flow.jsx
src/components/join-flow/join-flow.jsx
+0
-4
src/components/join-flow/registration-error-step.jsx
src/components/join-flow/registration-error-step.jsx
+0
-5
test/unit/components/email-step.test.jsx
test/unit/components/email-step.test.jsx
+6
-11
test/unit/components/registration-error-step.test.jsx
test/unit/components/registration-error-step.test.jsx
+0
-8
test/unit/components/username-step.test.jsx
test/unit/components/username-step.test.jsx
+3
-17
No files found.
src/components/join-flow/email-step.jsx
View file @
68fc4fe4
...
@@ -234,15 +234,7 @@ EmailStep.propTypes = {
...
@@ -234,15 +234,7 @@ EmailStep.propTypes = {
intl
:
intlShape
,
intl
:
intlShape
,
onCaptchaError
:
PropTypes
.
func
,
onCaptchaError
:
PropTypes
.
func
,
onNextStep
:
PropTypes
.
func
,
onNextStep
:
PropTypes
.
func
,
<
<<<<<<
HEAD
=======
onRegistrationError
:
PropTypes
.
func
,
<<<<<<<
HEAD
sendAnalytics
:
PropTypes
.
func
,
>
>>>>>>
Add analytics logging to join flow. Adding page views for each step in the flow.
=======
sendAnalytics
:
PropTypes
.
func
.
isRequired
,
sendAnalytics
:
PropTypes
.
func
.
isRequired
,
>>>>>>>
Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step.
waiting
:
PropTypes
.
bool
waiting
:
PropTypes
.
bool
};
};
...
...
src/components/join-flow/join-flow.jsx
View file @
68fc4fe4
...
@@ -233,12 +233,8 @@ class JoinFlow extends React.Component {
...
@@ -233,12 +233,8 @@ class JoinFlow extends React.Component {
{
this
.
state
.
registrationError
?
(
{
this
.
state
.
registrationError
?
(
<
RegistrationErrorStep
<
RegistrationErrorStep
canTryAgain=
{
this
.
canTryAgain
()
}
canTryAgain=
{
this
.
canTryAgain
()
}
<<<<<<<
HEAD
errorMsg=
{
this
.
state
.
registrationError
.
errorMsg
}
errorMsg=
{
this
.
state
.
registrationError
.
errorMsg
}
=======
errorMsg=
{
this
.
state
.
registrationError
}
sendAnalytics=
{
this
.
sendAnalytics
}
sendAnalytics=
{
this
.
sendAnalytics
}
>
>>>>>>
Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step.
/* eslint-disable react/jsx-no-bind */
/* eslint-disable react/jsx-no-bind */
onSubmit=
{
this
.
handleErrorNext
}
onSubmit=
{
this
.
handleErrorNext
}
/* eslint-enable react/jsx-no-bind */
/* eslint-enable react/jsx-no-bind */
...
...
src/components/join-flow/registration-error-step.jsx
View file @
68fc4fe4
...
@@ -65,17 +65,12 @@ RegistrationErrorStep.propTypes = {
...
@@ -65,17 +65,12 @@ RegistrationErrorStep.propTypes = {
canTryAgain
:
PropTypes
.
bool
.
isRequired
,
canTryAgain
:
PropTypes
.
bool
.
isRequired
,
errorMsg
:
PropTypes
.
string
,
errorMsg
:
PropTypes
.
string
,
intl
:
intlShape
,
intl
:
intlShape
,
<
<<<<<<
HEAD
onSubmit
:
PropTypes
.
func
.
isRequired
,
onSubmit
:
PropTypes
.
func
.
isRequired
,
sendAnalytics
:
PropTypes
.
func
.
isRequired
sendAnalytics
:
PropTypes
.
func
.
isRequired
};
};
RegistrationErrorStep
.
defaultProps
=
{
RegistrationErrorStep
.
defaultProps
=
{
canTryAgain
:
false
canTryAgain
:
false
=======
onSubmit
:
PropTypes
.
func
,
sendAnalytics
:
PropTypes
.
func
.
isRequired
>
>>>>>>
Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step.
};
};
const
IntlRegistrationErrorStep
=
injectIntl
(
RegistrationErrorStep
);
const
IntlRegistrationErrorStep
=
injectIntl
(
RegistrationErrorStep
);
...
...
test/unit/components/email-step.test.jsx
View file @
68fc4fe4
...
@@ -236,9 +236,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
...
@@ -236,9 +236,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
test
(
'
validateEmailRemotelyWithCache calls validate.validateEmailRemotely
'
,
done
=>
{
test
(
'
validateEmailRemotelyWithCache calls validate.validateEmailRemotely
'
,
done
=>
{
const
intlWrapper
=
shallowWithIntl
(
const
intlWrapper
=
shallowWithIntl
(
<
EmailStep
<
EmailStep
/>
{
...
defaultProps
()}
);
/>);
const
instance
=
intlWrapper
.
dive
().
instance
();
const
instance
=
intlWrapper
.
dive
().
instance
();
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
...
@@ -252,10 +251,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
...
@@ -252,10 +251,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
test
(
'
validateEmailRemotelyWithCache, called twice with different data, makes two remote requests
'
,
done
=>
{
test
(
'
validateEmailRemotelyWithCache, called twice with different data, makes two remote requests
'
,
done
=>
{
const
intlWrapper
=
shallowWithIntl
(
const
intlWrapper
=
shallowWithIntl
(
<
EmailStep
<
EmailStep
/>
{
...
defaultProps
()}
);
/>);
const
instance
=
intlWrapper
.
dive
().
instance
();
const
instance
=
intlWrapper
.
dive
().
instance
();
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
...
@@ -278,10 +275,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
...
@@ -278,10 +275,8 @@ describe('validateEmailRemotelyWithCache test with successful requests', () => {
test
(
'
validateEmailRemotelyWithCache, called twice with same data, only makes one remote request
'
,
done
=>
{
test
(
'
validateEmailRemotelyWithCache, called twice with same data, only makes one remote request
'
,
done
=>
{
const
intlWrapper
=
shallowWithIntl
(
const
intlWrapper
=
shallowWithIntl
(
<
EmailStep
<
EmailStep
/>
{
...
defaultProps
()}
);
/>);
const
instance
=
intlWrapper
.
dive
().
instance
();
const
instance
=
intlWrapper
.
dive
().
instance
();
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
instance
.
validateEmailRemotelyWithCache
(
'
some-email@some-domain.com
'
)
...
...
test/unit/components/registration-error-step.test.jsx
View file @
68fc4fe4
...
@@ -10,19 +10,13 @@ describe('RegistrationErrorStep', () => {
...
@@ -10,19 +10,13 @@ describe('RegistrationErrorStep', () => {
const
getRegistrationErrorStepWrapper
=
props
=>
{
const
getRegistrationErrorStepWrapper
=
props
=>
{
const
wrapper
=
shallowWithIntl
(
const
wrapper
=
shallowWithIntl
(
<
RegistrationErrorStep
<
RegistrationErrorStep
<<<<<<<
HEAD
=======
errorMsg=
{
'
error message
'
}
sendAnalytics=
{
jest
.
fn
()
}
sendAnalytics=
{
jest
.
fn
()
}
onSubmit=
{
onSubmit
}
>
>>>>>>
Add analytics logging to join flow. Adding page views for each step in the flow.
{
...
props
}
{
...
props
}
/>
/>
);
);
return
wrapper
return
wrapper
.
dive
();
// unwrap injectIntl()
.
dive
();
// unwrap injectIntl()
};
};
<
<<<<<<
HEAD
test
(
'
registrationError has JoinFlowStep
'
,
()
=>
{
test
(
'
registrationError has JoinFlowStep
'
,
()
=>
{
const
props
=
{
const
props
=
{
...
@@ -69,7 +63,6 @@ describe('RegistrationErrorStep', () => {
...
@@ -69,7 +63,6 @@ describe('RegistrationErrorStep', () => {
expect
(
errMsgElement
).
toHaveLength
(
0
);
expect
(
errMsgElement
).
toHaveLength
(
0
);
});
});
=======
test
(
'
logs to analytics
'
,
()
=>
{
test
(
'
logs to analytics
'
,
()
=>
{
const
analyticsFn
=
jest
.
fn
();
const
analyticsFn
=
jest
.
fn
();
mountWithIntl
(
mountWithIntl
(
...
@@ -78,7 +71,6 @@ describe('RegistrationErrorStep', () => {
...
@@ -78,7 +71,6 @@ describe('RegistrationErrorStep', () => {
/>);
/>);
expect
(
analyticsFn
).
toHaveBeenCalledWith
(
'
join-error
'
);
expect
(
analyticsFn
).
toHaveBeenCalledWith
(
'
join-error
'
);
});
});
>>>>>>>
Set sendAnalytics to be required and send the right props to the error step. Also add a test for the error step.
test
(
'
when canTryAgain is true, show tryAgain message
'
,
()
=>
{
test
(
'
when canTryAgain is true, show tryAgain message
'
,
()
=>
{
const
props
=
{
const
props
=
{
canTryAgain
:
true
,
canTryAgain
:
true
,
...
...
test/unit/components/username-step.test.jsx
View file @
68fc4fe4
...
@@ -34,17 +34,14 @@ jest.mock('../../../src/lib/validate.js', () => (
...
@@ -34,17 +34,14 @@ jest.mock('../../../src/lib/validate.js', () => (
// must come after validation mocks, so validate.js will be mocked before it is required
// must come after validation mocks, so validate.js will be mocked before it is required
const
UsernameStep
=
require
(
'
../../../src/components/join-flow/username-step.jsx
'
);
const
UsernameStep
=
require
(
'
../../../src/components/join-flow/username-step.jsx
'
);
<
<<<<<<
HEAD
describe
(
'
UsernameStep tests
'
,
()
=>
{
describe
(
'
UsernameStep tests
'
,
()
=>
{
=======
describe
(
'
UsernameStep test
'
,
()
=>
{
const
defaultProps
=
()
=>
({
const
defaultProps
=
()
=>
({
sendAnalytics
:
jest
.
fn
()
sendAnalytics
:
jest
.
fn
()
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
jest
.
clearAllMocks
();
jest
.
clearAllMocks
();
});
});
>>>>>>>
Add
analytics
logging
to
join
flow
.
Adding
page
views
for
each
step
in
the
flow
.
test
(
'
send correct props to formik
'
,
()
=>
{
test
(
'
send correct props to formik
'
,
()
=>
{
const
wrapper
=
shallowWithIntl
(<
UsernameStep
const
wrapper
=
shallowWithIntl
(<
UsernameStep
...
@@ -111,14 +108,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
...
@@ -111,14 +108,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
});
});
test
(
'
validateUsernameRemotelyWithCache calls validate.validateUsernameRemotely
'
,
done
=>
{
test
(
'
validateUsernameRemotelyWithCache calls validate.validateUsernameRemotely
'
,
done
=>
{
<<
<
<<<<
HEAD
const
wrapper
=
shallowWithIntl
(<
UsernameStep
/>);
const
wrapper
=
shallowWithIntl
(<
UsernameStep
/>);
=======
const
wrapper
=
shallowWithIntl
(
<
UsernameStep
{
...
defaultProps
()}
/>);
>>>>>>>
Add
analytics
logging
to
join
flow
.
Adding
page
views
for
each
step
in
the
flow
.
const
instance
=
wrapper
.
dive
().
instance
();
const
instance
=
wrapper
.
dive
().
instance
();
instance
.
validateUsernameRemotelyWithCache
(
'
newUniqueUsername55
'
)
instance
.
validateUsernameRemotelyWithCache
(
'
newUniqueUsername55
'
)
...
@@ -133,9 +123,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
...
@@ -133,9 +123,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
test
(
'
validateUsernameRemotelyWithCache, called twice with different data, makes two remote requests
'
,
done
=>
{
test
(
'
validateUsernameRemotelyWithCache, called twice with different data, makes two remote requests
'
,
done
=>
{
const
wrapper
=
shallowWithIntl
(
const
wrapper
=
shallowWithIntl
(
<
UsernameStep
<
UsernameStep
/>
{
...
defaultProps
()}
/>
);
);
const
instance
=
wrapper
.
dive
().
instance
();
const
instance
=
wrapper
.
dive
().
instance
();
...
@@ -161,9 +149,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
...
@@ -161,9 +149,7 @@ describe('validateUsernameRemotelyWithCache test with successful requests', () =
test
(
'
validateUsernameRemotelyWithCache, called twice with same data, only makes one remote request
'
,
done
=>
{
test
(
'
validateUsernameRemotelyWithCache, called twice with same data, only makes one remote request
'
,
done
=>
{
const
wrapper
=
shallowWithIntl
(
const
wrapper
=
shallowWithIntl
(
<
UsernameStep
<
UsernameStep
/>
{
...
defaultProps
()}
/>
);
);
const
instance
=
wrapper
.
dive
().
instance
();
const
instance
=
wrapper
.
dive
().
instance
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment