Skip to content

Issue#4709 : Track and Subtrack enhancements : Details page #4728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ test('Matches shallow shapshot', () => {
submissionObjects={[{
id: '12345',
}]}
type="DESIGN"
track="Design"
/>
));
expect(renderer.getRenderOutput()).toMatchSnapshot();

renderer.render((
<SubmissionsTable
showDetails={{ 12345: true }}
type="DESIGN"
track="Design"
/>
));
expect(renderer.getRenderOutput()).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports[`Matches shallow shapshot 1`] = `
"id": "12345",
}
}
type="DESIGN"
track="Design"
/>
<tr
className="src-shared-components-SubmissionManagement-SubmissionsTable-___styles__submission-row___1uclT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
>
<div
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
>
CH
</div>
Expand All @@ -26,15 +26,15 @@ exports[`Matches shallow shapshot 2`] = `
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
>
<div
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
>
CH
</div>
<a
href="https://www.topcoder-dev.com/tco"
>
<div
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
>
TCO
</div>
Expand All @@ -47,15 +47,15 @@ exports[`Matches shallow shapshot 3`] = `
className="src-shared-components-TrackIcon-___style__trackIcon___3gJ9l"
>
<div
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__main-icon___1q-1_"
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__main-icon___1q-1_"
>
CH
</div>
<a
href="https://www.topcoder-dev.com/tco"
>
<div
className="src-shared-components-TrackIcon-___style__develop___3v4fM src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
className="src-shared-components-TrackIcon-___style__development___1LZdf src-shared-components-TrackIcon-___style__tco-icon___18ZV7"
>
TCO
</div>
Expand Down
11 changes: 8 additions & 3 deletions __tests__/shared/components/TrackIcon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ import TrackIcon from 'components/TrackIcon';
test('Matches shallow shapshot', () => {
const renderer = new Renderer();

const type = {
name: 'Challenge',
abbreviation: 'CH',
};

renderer.render((
<TrackIcon track="DEVELOP" subTrack="CODE" />
<TrackIcon track="Development" type={type} />
));
expect(renderer.getRenderOutput()).toMatchSnapshot();

renderer.render((
<TrackIcon track="DEVELOP" subTrack="CODE" isDataScience tcoEligible="yes" />
<TrackIcon track="Development" type={type} isDataScience tcoEligible="yes" />
));
expect(renderer.getRenderOutput()).toMatchSnapshot();

renderer.render((
<TrackIcon track="DEVELOP" subTrack="CODE" isDataScience={false} tcoEligible="yes" />
<TrackIcon track="Development" type={type} isDataScience={false} tcoEligible="yes" />
));
expect(renderer.getRenderOutput()).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
"eventName": "Submit",
},
],
"legacy": Object {
"track": "DEVELOP",
},
"prize": Array [
1200,
600,
Expand All @@ -30,18 +27,24 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
600,
],
"status": "ACTIVE",
"subTrack": "CODE",
"tags": Array [
"Data Science",
],
"technologies": Array [
"Data Science",
],
"totalPrize": 1800,
"track": "Data Science",
"type": "Challenge",
"users": Object {},
}
}
challengeTypes={Array []}
challengeType={
Object {
"abbreviation": "CH",
"name": "Challenge",
}
}
domRef={null}
expandTag={null}
expandedTags={Array []}
Expand All @@ -67,25 +70,28 @@ exports[`Matches shallow shapshot shapshot 2 1`] = `
],
"events": Array [],
"id": "1",
"legacy": Object {
"track": "DATA_SCIENCE",
},
"prizes": Array [
1200,
600,
],
"subTrack": "CODE",
"tags": Array [
"Go",
],
"technologies": Array [
"Go",
],
"totalPrize": 1800,
"track": "Data Science",
"type": "Challenge",
"users": Object {},
}
}
challengeTypes={Array []}
challengeType={
Object {
"abbreviation": "CH",
"name": "Challenge",
}
}
domRef={null}
expandTag={null}
expandedTags={Array []}
Expand All @@ -111,21 +117,24 @@ exports[`Matches shallow shapshot shapshot 3 1`] = `
],
"events": Array [],
"id": "long id",
"legacy": Object {
"track": "DATA_SCIENCE",
},
"prizes": Array [
1200,
600,
],
"subTrack": "CODE",
"tags": Array [],
"technologies": Array [],
"totalPrize": 1800,
"track": "Data Science",
"type": "Challenge",
"users": Object {},
}
}
challengeTypes={Array []}
challengeType={
Object {
"abbreviation": "CH",
"name": "Challenge",
}
}
domRef={null}
expandTag={null}
expandedTags={Array []}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ const mockData1 = {
}],
currentPhases: ['Registration'],
prizes: [1200, 600],
legacy: {
track: 'DEVELOP',
},
track: 'Data Science',
type: 'Challenge',
totalPrize: 1800,
subTrack: 'CODE',
events: [{ eventName: 'Submit' }],
status: 'ACTIVE',
users: {},
},
challengeType: {
name: 'Challenge',
abbreviation: 'CH',
},
};

const mockData2 = {
Expand All @@ -49,15 +51,17 @@ const mockData2 = {
}],
currentPhases: ['Registration'],
prizes: [1200, 600],
legacy: {
track: 'DATA_SCIENCE',
},
subTrack: 'CODE',
track: 'Data Science',
type: 'Challenge',
id: '1',
totalPrize: 1800,
users: {},
events: [],
},
challengeType: {
name: 'Challenge',
abbreviation: 'CH',
},
};

const mockData3 = {
Expand All @@ -70,15 +74,17 @@ const mockData3 = {
}],
currentPhases: ['Registration'],
prizes: [1200, 600],
legacy: {
track: 'DATA_SCIENCE',
},
subTrack: 'CODE',
track: 'Data Science',
type: 'Challenge',
id: 'long id',
totalPrize: 1800,
users: {},
events: [],
},
challengeType: {
name: 'Challenge',
abbreviation: 'CH',
},
};

const mockData4 = {
Expand All @@ -91,15 +97,17 @@ const mockData4 = {
}],
currentPhases: ['Registration'],
prizes: [1200, 600],
legacy: {
track: 'DATA_SCIENCE',
},
subTrack: 'CODE',
track: 'Data Science',
type: 'Challenge',
id: 'long id',
totalPrize: 1800,
users: {},
events: [],
},
challengeType: {
name: 'Challenge',
abbreviation: 'CH',
},
};

const mockData5 = {
Expand All @@ -112,15 +120,17 @@ const mockData5 = {
}],
currentPhases: ['Registration'],
prizes: [1200, 600],
legacy: {
track: 'DATA_SCIENCE',
},
subTrack: 'CODE',
track: 'Data Science',
type: 'Challenge',
id: 'long id',
totalPrize: 1800,
users: {},
events: [],
},
challengeType: {
name: 'Challenge',
abbreviation: 'CH',
},
};

describe('Matches shallow shapshot', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const mockDatas = [{
prizes: [1200, 600],
totalPrize: 1800,
users: {},
type: 'Challenge',
},
{
id: '2',
Expand All @@ -43,15 +44,25 @@ const mockDatas = [{
phaseStatus: 'Open',
}],
currentPhases: ['Registration'],
legacy: {
track: 'DEVELOP',
},
subTrack: 'CODE',
track: 'Development',
type: 'Challenge',
events: [{ eventName: 'Submit' }],
prizes: [1200, 600],
totalPrize: 1800,
users: {},
}],
challengeTypes: [
{
name: 'Challenge',
abbreviation: 'CH',
}, {
name: 'First2Finish',
abbreviation: 'F2F',
}, {
name: 'Task',
abbreviation: 'TSK',
},
],
loading: false,
loadMore,
setFilterState,
Expand Down Expand Up @@ -145,6 +156,18 @@ const mockDatas = [{
users: {},
},
],
challengeTypes: [
{
name: 'Challenge',
abbreviation: 'CH',
}, {
name: 'First2Finish',
abbreviation: 'F2F',
}, {
name: 'Task',
abbreviation: 'TSK',
},
],
loading: true,
loadMore,
setFilterState,
Expand All @@ -161,6 +184,18 @@ const mockDatas = [{
expand,
challenges: [
],
challengeTypes: [
{
name: 'Challenge',
abbreviation: 'CH',
}, {
name: 'First2Finish',
abbreviation: 'F2F',
}, {
name: 'Task',
abbreviation: 'TSK',
},
],
loading: true,
setFilterState,
setSort,
Expand Down
Loading