Skip to content

Commit f0f9de3

Browse files
authored
Merge pull request #6823 from topcoder-platform/marathon_match_submission_download
Marathon match submission download / Collapsible timeline / Markdown rendering updates
2 parents 73b19e8 + b36957a commit f0f9de3

File tree

33 files changed

+881
-122
lines changed

33 files changed

+881
-122
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ workflows:
364364
branches:
365365
only:
366366
- universal_nav
367+
- marathon_match_submission_download
367368
- feat/badges-box
368369
# This is beta env for production soft releases
369370
- "build-prod-beta":
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Matches shallow shapshot shapshot 1 1`] = `
4+
<div
5+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__container___1WzuZ"
6+
>
7+
<div
8+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__row___tH5eB src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__no-border___1tHzW"
9+
>
10+
<div
11+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-1___3g3Tt src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE"
12+
>
13+
<div
14+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
15+
>
16+
SUBMISSION
17+
</div>
18+
<span>
19+
1
20+
</span>
21+
</div>
22+
<div
23+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-2___2KjRa src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE"
24+
>
25+
<div
26+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
27+
>
28+
FINAL SCORE
29+
</div>
30+
<div>
31+
N/A
32+
</div>
33+
</div>
34+
<div
35+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-3___3MsR- src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE"
36+
>
37+
<div
38+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
39+
>
40+
PROVISIONAL SCORE
41+
</div>
42+
<div>
43+
80
44+
</div>
45+
</div>
46+
<div
47+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-4___SJw2x src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mm___2y_Fx"
48+
>
49+
<div
50+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
51+
>
52+
TIME
53+
</div>
54+
<div>
55+
06 Nov 2017
56+
57+
15:49:35
58+
</div>
59+
</div>
60+
<div
61+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-2___2KjRa src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__center___2l_Ch"
62+
>
63+
<div
64+
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
65+
>
66+
Action
67+
</div>
68+
<button
69+
onClick={[Function]}
70+
type="button"
71+
>
72+
<DownloadIcon
73+
fill="none"
74+
height="18"
75+
viewBox="0 0 18 18"
76+
width="18"
77+
xmlns="http://www.w3.org/2000/svg"
78+
/>
79+
</button>
80+
</div>
81+
</div>
82+
</div>
83+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React from 'react';
2+
// import ReactDOM from 'react-dom';
3+
import Renderer from 'react-test-renderer/shallow';
4+
import TU from 'react-dom/test-utils';
5+
import SubmissionHistoryRow from 'components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow';
6+
7+
const mockData = {
8+
isMM: true,
9+
submission: 1,
10+
finalScore: 80,
11+
provisionalScore: 80,
12+
submissionTime: '2017-11-06T15:49:35.000Z',
13+
isReviewPhaseComplete: false,
14+
status: 'completed',
15+
numWinners: 1,
16+
challengeStatus: 'Completed',
17+
auth: {
18+
tokenV3: 'tokenV3',
19+
},
20+
submissionId: '1',
21+
isLoggedIn: true,
22+
};
23+
24+
describe('Matches shallow shapshot', () => {
25+
test('shapshot 1', () => {
26+
const renderer = new Renderer();
27+
28+
renderer.render((
29+
<SubmissionHistoryRow {...mockData} />
30+
));
31+
expect(renderer.getRenderOutput()).toMatchSnapshot();
32+
});
33+
});
34+
35+
class Wrapper extends React.Component {
36+
componentDidMount() {}
37+
38+
render() {
39+
return <SubmissionHistoryRow {...this.props} />;
40+
}
41+
}
42+
43+
describe('render properly', () => {
44+
test('click', () => {
45+
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
46+
const matches = TU.scryRenderedDOMComponentsWithTag(instance, 'button');
47+
expect(matches).toHaveLength(1);
48+
TU.Simulate.click(matches[0]);
49+
});
50+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Matches shallow shapshot shapshot 1 1`] = `
4+
<div
5+
className="src-shared-components-challenge-detail-Winners-Winner-___style__winner___GzUxl"
6+
>
7+
<div
8+
className="src-shared-components-challenge-detail-Winners-Winner-___style__left___3hdSd"
9+
>
10+
<div
11+
className="src-shared-components-challenge-detail-Winners-Winner-___style__placement___Qyy47 src-shared-components-challenge-detail-Winners-Winner-___style__placement-1___1LrAQ"
12+
>
13+
<span>
14+
1th
15+
</span>
16+
</div>
17+
<div
18+
className="src-shared-components-challenge-detail-Winners-Winner-___style__info___37iL7"
19+
>
20+
<div
21+
className="src-shared-components-challenge-detail-Winners-Winner-___style__avatar-prize___1LtwD"
22+
>
23+
<ThemedAvatar
24+
composeAdhocTheme="deeply"
25+
composeContextTheme="softly"
26+
mapThemrProps={[Function]}
27+
theme={
28+
Object {
29+
"avatar": "src-shared-components-challenge-detail-Winners-Winner-style___avatar___18tFlU",
30+
}
31+
}
32+
themePriority="adhoc-context-default"
33+
/>
34+
<div>
35+
<a
36+
className="src-shared-components-challenge-detail-Winners-Winner-___style__handle___2klay"
37+
href="undefined/members/test"
38+
target="_blank"
39+
>
40+
test
41+
</a>
42+
</div>
43+
</div>
44+
</div>
45+
</div>
46+
<div
47+
className="src-shared-components-challenge-detail-Winners-Winner-___style__right___1SPxZ"
48+
>
49+
<div
50+
className="src-shared-components-challenge-detail-Winners-Winner-___style__prize___1snZ8"
51+
>
52+
$
53+
200
54+
</div>
55+
</div>
56+
<div
57+
className="src-shared-components-challenge-detail-Winners-Winner-___style__download-container___OXVza"
58+
>
59+
<button
60+
onClick={[Function]}
61+
type="button"
62+
>
63+
<DownloadIcon
64+
fill="none"
65+
height="18"
66+
viewBox="0 0 18 18"
67+
width="18"
68+
xmlns="http://www.w3.org/2000/svg"
69+
/>
70+
</button>
71+
</div>
72+
</div>
73+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React from 'react';
2+
// import ReactDOM from 'react-dom';
3+
import Renderer from 'react-test-renderer/shallow';
4+
import TU from 'react-dom/test-utils';
5+
import Winner from 'components/challenge-detail/Winners/Winner';
6+
7+
const mockData = {
8+
isDesign: false,
9+
isMM: true,
10+
prizes: [
11+
{ value: 200, type: 'USD' },
12+
{ value: 100, type: 'USD' },
13+
],
14+
submissions: [
15+
{
16+
placement: 1,
17+
createdBy: 'test',
18+
created: '2017-11-06T15:49:35.000Z',
19+
id: '1',
20+
},
21+
{
22+
placement: 1,
23+
createdBy: 'test',
24+
created: '2017-12-06T15:49:35.000Z',
25+
id: '2',
26+
},
27+
{
28+
placement: 1,
29+
createdBy: 'test2',
30+
created: '2017-11-06T15:49:35.000Z',
31+
id: '3',
32+
},
33+
],
34+
viewable: false,
35+
winner: {
36+
handle: 'test',
37+
placement: 1,
38+
},
39+
isLoggedIn: true,
40+
auth: {
41+
tokenV3: 'tokenV3',
42+
},
43+
};
44+
45+
describe('Matches shallow shapshot', () => {
46+
test('shapshot 1', () => {
47+
const renderer = new Renderer();
48+
49+
renderer.render((
50+
<Winner {...mockData} />
51+
));
52+
expect(renderer.getRenderOutput()).toMatchSnapshot();
53+
});
54+
});
55+
56+
class Wrapper extends React.Component {
57+
componentDidMount() {}
58+
59+
render() {
60+
return <Winner {...this.props} />;
61+
}
62+
}
63+
64+
describe('render properly', () => {
65+
test('click', () => {
66+
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
67+
const matches = TU.scryRenderedDOMComponentsWithTag(instance, 'button');
68+
expect(matches).toHaveLength(1);
69+
TU.Simulate.click(matches[0]);
70+
});
71+
});

0 commit comments

Comments
 (0)