Skip to content
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

fix: remove faker from application code #1194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
74 changes: 37 additions & 37 deletions src/components/ContentHighlights/data/constants.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { faker } from '@faker-js/faker';
import parse from 'html-react-parser';
import sanitizeHTML from 'sanitize-html';
import { v4 as uuidv4 } from 'uuid';
/* eslint-enable import/no-extraneous-dependencies */

// Sanitizes HTML and parses the string as HTML
Expand Down Expand Up @@ -185,14 +185,14 @@ export const NEW_ARCHIVED_CONTENT_ALERT_DISMISSED_COOKIE_NAME = 'new-archived-co
// Test Content Highlights data
export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
title: 'Dire Core',
is_published: true,
enterprise_curation: '321123',
highlighted_content:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_type: 'Course',
content_key: 'edX+DemoX',
title: 'Math',
Expand All @@ -201,12 +201,12 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
name: 'General Studies 1',
logo_image_url: 'https://placekitten.com/200/100',
},
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Super General Studies',
},
Expand All @@ -215,14 +215,14 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Science',
content_type: 'Learnerpathway',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
course_run_statuses: [COURSE_RUN_STATUSES.published],
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'General Studies 2',
},
Expand All @@ -231,14 +231,14 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'English',
content_type: 'Program',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
course_run_statuses: null,
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'General Studies 3',
},
Expand All @@ -248,21 +248,21 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
},
{
title: 'Dire Math',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
is_published: true,
enterprise_curation: '321123',
highlighted_content:
[
{
title: 'Math Xtreme',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Matheletes',
},
Expand All @@ -271,13 +271,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Science for Math Majors',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Matheletes',
},
Expand All @@ -286,13 +286,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'English Divergence',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Matheletes',
},
Expand All @@ -302,21 +302,21 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
},
{
title: 'Dire Science',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
is_published: false,
enterprise_curation: '321123',
highlighted_content:
[
{
title: 'Math for Science Majors',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'The Beakers',
},
Expand All @@ -325,13 +325,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Science Xtreme',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'The Beakers',
},
Expand All @@ -340,13 +340,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'English Obfuscation',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'The Beakers',
},
Expand All @@ -356,21 +356,21 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
},
{
title: 'Dire English',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
is_published: true,
enterprise_curation: '321123',
highlighted_content:
[
{
title: 'To Math or not Math',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Extensive Etymology',
},
Expand All @@ -379,13 +379,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Science for English Majors',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Extensive Etymology',
},
Expand All @@ -394,13 +394,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Moore English: Lawlessness Refined',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Extensive Etymology',
},
Expand All @@ -410,21 +410,21 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
},
{
title: 'Dire Engineering',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
is_published: true,
enterprise_curation: '321123',
highlighted_content:
[
{
title: 'Math for Engineering Majors',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Building Bridges',
},
Expand All @@ -433,13 +433,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'Science for Engineering Majors',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Building Bridges',
},
Expand All @@ -448,13 +448,13 @@ export const TEST_COURSE_HIGHLIGHTS_DATA = [
{
title: 'English Instantiation',
content_type: 'Course',
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
content_key: 'edX+DemoX',
card_image_url: 'https://picsum.photos/360/200',
authoring_organizations:
[
{
uuid: faker.datatype.uuid(),
uuid: uuidv4(),
logo_image_url: 'https://placekitten.com/200/100',
name: 'Building Bridges',
},
Expand Down
Loading