mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): remove before/after-user-code in react-and-redux block (#66485)
This commit is contained in:
@@ -64,12 +64,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
ReactDOM.render(<DisplayMessages />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -158,12 +158,6 @@ The `submitMessage` method should clear the current input.
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
ReactDOM.render(<DisplayMessages />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -81,12 +81,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
ReactDOM.render(<AppWrapper />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -29,6 +29,21 @@ The `Presentational` component should render.
|
||||
```js
|
||||
assert(
|
||||
(function () {
|
||||
if (typeof ConnectedComponent === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
const store = Redux.createStore(
|
||||
(state = '__INITIAL__STATE__', action) => state
|
||||
);
|
||||
class AppWrapper extends React.Component {
|
||||
render() {
|
||||
return React.createElement(
|
||||
ReactRedux.Provider,
|
||||
{ store: store },
|
||||
React.createElement(ConnectedComponent)
|
||||
);
|
||||
}
|
||||
}
|
||||
const mockedComponent = Enzyme.mount(React.createElement(AppWrapper));
|
||||
return mockedComponent.find('Presentational').length === 1;
|
||||
})()
|
||||
@@ -40,6 +55,21 @@ The `Presentational` component should receive a prop `messages` via `connect`.
|
||||
```js
|
||||
assert(
|
||||
(function () {
|
||||
if (typeof ConnectedComponent === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
const store = Redux.createStore(
|
||||
(state = '__INITIAL__STATE__', action) => state
|
||||
);
|
||||
class AppWrapper extends React.Component {
|
||||
render() {
|
||||
return React.createElement(
|
||||
ReactRedux.Provider,
|
||||
{ store: store },
|
||||
React.createElement(ConnectedComponent)
|
||||
);
|
||||
}
|
||||
}
|
||||
const mockedComponent = Enzyme.mount(React.createElement(AppWrapper));
|
||||
const props = mockedComponent.find('Presentational').props();
|
||||
return props.messages === '__INITIAL__STATE__';
|
||||
@@ -52,6 +82,21 @@ The `Presentational` component should receive a prop `submitNewMessage` via `con
|
||||
```js
|
||||
assert(
|
||||
(function () {
|
||||
if (typeof ConnectedComponent === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
const store = Redux.createStore(
|
||||
(state = '__INITIAL__STATE__', action) => state
|
||||
);
|
||||
class AppWrapper extends React.Component {
|
||||
render() {
|
||||
return React.createElement(
|
||||
ReactRedux.Provider,
|
||||
{ store: store },
|
||||
React.createElement(ConnectedComponent)
|
||||
);
|
||||
}
|
||||
}
|
||||
const mockedComponent = Enzyme.mount(React.createElement(AppWrapper));
|
||||
const props = mockedComponent.find('Presentational').props();
|
||||
return typeof props.submitNewMessage === 'function';
|
||||
@@ -61,24 +106,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
const store = Redux.createStore(
|
||||
(state = '__INITIAL__STATE__', action) => state
|
||||
);
|
||||
class AppWrapper extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<ReactRedux.Provider store = {store}>
|
||||
<ConnectedComponent/>
|
||||
</ReactRedux.Provider>
|
||||
);
|
||||
}
|
||||
};
|
||||
ReactDOM.render(<AppWrapper />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -96,12 +96,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
ReactDOM.render(<AppWrapper />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
@@ -185,12 +185,6 @@ The `Presentational` component should render the `messages` from the Redux store
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```jsx
|
||||
ReactDOM.render(<AppWrapper />, document.getElementById('root'))
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```jsx
|
||||
|
||||
Reference in New Issue
Block a user