fix(api): show most recent date for FullStack cert (#38736)

This commit is contained in:
Oliver Eyton-Williams
2020-05-06 15:24:12 +02:00
committed by GitHub
parent f529104348
commit 9451328a85
3 changed files with 65 additions and 7 deletions

View File

@ -0,0 +1,12 @@
/* global it expect */
import { getFallbackFrontEndDate } from '../boot/certificate';
import { fullStackChallenges } from './fixtures';
describe('boot/certificate', () => {
describe('getFallbackFrontEndDate', () => {
it('should return the date of the latest completed challenge', () => {
expect(getFallbackFrontEndDate(fullStackChallenges)).toBe(1685210952511);
});
});
});

View File

@ -178,3 +178,42 @@ export const mockPathMigrationMap = {
'challenge-one': '/learn/superblock/block/challenge-one',
'challenge-two': '/learn/superblock/block/challenge-two'
};
export const fullStackChallenges = [
{
completedDate: 1585210952511,
id: '5a553ca864b52e1d8bceea14',
challengeType: 7,
files: []
},
{
completedDate: 1585210952511,
id: '561add10cb82ac38a17513bc',
challengeType: 7,
files: []
},
{
completedDate: 1588665778679,
id: '561acd10cb82ac38a17513bc',
challengeType: 7,
files: []
},
{
completedDate: 1685210952511,
id: '561abd10cb81ac38a17513bc',
challengeType: 7,
files: []
},
{
completedDate: 1585210952511,
id: '561add10cb82ac38a17523bc',
challengeType: 7,
files: []
},
{
completedDate: 1588665778679,
id: '561add10cb82ac38a17213bc',
challengeType: 7,
files: []
}
];