Skip to content

Commit f8bc937

Browse files
committed
Fix several pre-prod issues
1 parent 76bba16 commit f8bc937

File tree

4 files changed

+87
-10
lines changed

4 files changed

+87
-10
lines changed

client/src/templates/Challenges/rechallenge/transformers.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,24 @@ export const embedFilesInHtml = async function (challengeFiles) {
220220
const style = contentDocument.createElement('style');
221221
style.classList.add('fcc-injected-styles');
222222
style.innerHTML = stylesCss?.contents;
223-
224223
link.parentNode.replaceChild(style, link);
224+
} else if (stylesCss?.contents) {
225+
// automatic linking of style contents to html
226+
const style = contentDocument.createElement('style');
227+
style.classList.add('fcc-injected-styles');
228+
style.innerHTML = stylesCss?.contents;
229+
contentDocument.head.appendChild(style);
225230
}
226231
if (script) {
227-
const script = (contentDocument.createElement('script').innerHTML =
228-
scriptJs?.contents);
229-
link.parentNode.replaceChild(script, link);
232+
const newScript = contentDocument.createElement('script');
233+
newScript.innerHTML = scriptJs?.contents;
234+
script.parentNode.replaceChild(newScript, script);
235+
}
236+
if (indexJsx?.contents) {
237+
// automatic linking of jsx to html
238+
const newScript = contentDocument.createElement('script');
239+
newScript.innerHTML = indexJsx?.contents;
240+
contentDocument.head.appendChild(newScript);
230241
}
231242
return {
232243
contents: documentElement.innerHTML

client/src/templates/Challenges/redux/execute-challenge-saga.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function* buildChallengeData(challengeData, options) {
175175
}
176176
}
177177

178-
function* executeTests(testRunner, tests, testTimeout = 5000) {
178+
function* executeTests(testRunner, tests, testTimeout = 70000) {
179179
const testResults = [];
180180
for (let i = 0; i < tests.length; i++) {
181181
const { text, testString } = tests[i];

curriculum/challenges/_meta/front-end-development-libraries-projects/meta.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,27 @@
44
"dashedName": "front-end-development-libraries-projects",
55
"order": 6,
66
"time": "150 hours",
7-
"template": "",
8-
"required": [],
7+
"template": "<body><div id='root'></div>${ source || '' }</body>",
8+
"required": [
9+
{
10+
"link": "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css"
11+
},
12+
{
13+
"src": "https://code.jquery.com/jquery-3.6.0.min.js"
14+
},
15+
{
16+
"src": "https://unpkg.com/react@16.4.0/umd/react.production.min.js"
17+
},
18+
{
19+
"src": "https://unpkg.com/react-dom@16.4.0/umd/react-dom.production.min.js"
20+
},
21+
{
22+
"src": "https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.min.js"
23+
},
24+
{
25+
"src": "https://cdnjs.cloudflare.com/ajax/libs/react-redux/5.0.7/react-redux.min.js"
26+
}
27+
],
928
"superBlock": "front-end-development-libraries",
1029
"challengeOrder": [
1130
[

curriculum/challenges/english/03-front-end-development-libraries/front-end-development-libraries-projects/build-a-25-5-clock.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dashedName: build-a-25--5-clock
88

99
# --description--
1010

11-
**Objective:** Build a [CodePen.io](https://codepen.io) app that is functionally similar to this: <https://codepen.io/freeCodeCamp/full/XpKrrW>.
11+
**Objective:** Build an app that is functionally similar to this: <https://codepen.io/freeCodeCamp/full/XpKrrW>.
1212

1313
Fulfill the below [user stories](https://en.wikipedia.org/wiki/User_story) and get all of the tests to pass. Give it your own personal style.
1414

@@ -1210,18 +1210,65 @@ assert.strictEqual(
12101210

12111211
# --seed--
12121212

1213+
## --after-user-code--
1214+
1215+
```jsx
1216+
ReactDOM.render(<App />, document.getElementById('root'))
1217+
```
1218+
12131219
## --seed-contents--
12141220

12151221
```html
1216-
1222+
<!DOCTYPE html>
1223+
<html>
1224+
<body>
1225+
<!--Change code below this line-->
1226+
<p>Hello from HTML!</p>
1227+
<!--Change code above this line-->
1228+
</body>
1229+
</html>
12171230
```
12181231

12191232
```css
12201233

12211234
```
12221235

1236+
```jsx
1237+
class App extends React.Component {
1238+
constructor(props) {
1239+
super(props);
1240+
}
1241+
1242+
render() {
1243+
return (
1244+
<div>
1245+
{ /* Change code below this line */ }
1246+
<Timer />
1247+
{ /* Change code above this line */ }
1248+
</div>
1249+
);
1250+
}
1251+
};
1252+
1253+
class Timer extends React.Component {
1254+
constructor(props) {
1255+
super(props);
1256+
1257+
}
1258+
render() {
1259+
return (
1260+
<div>
1261+
{ /* Change code below this line */ }
1262+
<p>Hello from JSX !</p>
1263+
{ /* Change code above this line */ }
1264+
</div>
1265+
);
1266+
}
1267+
};
1268+
```
1269+
12231270
# --solutions--
12241271

1225-
```js
1272+
```jsx
12261273
// solution required
12271274
```

0 commit comments

Comments
 (0)