docbrown/app/javascript/articles/__tests__/utilities/articleUtilities.js
Nick Taylor 653ec12300
Upgrade to Preact 10.4.4 (#8739)
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2020-06-18 10:07:17 -04:00

322 lines
7.9 KiB
JavaScript

export const assetPath = (relativeUrl) => `/images/${relativeUrl}`;
export const article = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
published_at: '2020-02-18T14:59:24Z',
readable_publish_date: 'February 18',
top_comments: [],
main_image: '/images/10.png',
};
export const articleWithOrganization = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
readable_publish_date: 'February 18',
top_comments: [],
organization: {
id: 87120,
name: 'Web info-mediaries',
slug: 'bluetooth-Gorgeous-Wooden-Pants',
profile_image_90: '/images/30.png',
},
main_image: '/images/10.png',
};
export const articleWithSnippetResult = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
published_at: '2020-02-18T14:59:24Z',
readable_publish_date: 'February 18',
top_comments: [],
highlight: {
body_text: [
'copying Rest withdrawal Handcrafted multi-state Pre-emptive e-markets feed',
'overriding RSS Fantastic Plastic Gloves invoice productize systemic Monaco',
],
},
};
export const articleWithReactions = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
published_at: '2020-03-19T10:04:15-05:00',
readable_publish_date: 'February 18',
top_comments: [],
public_reactions_count: 232,
};
export const articleWithComments = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
published_at: '2020-03-19T10:04:15-05:00',
readable_publish_date: 'February 18',
top_comments: [
{
comment_id: 23,
user_id: 6,
published_timestamp: '2020-04-21T19:41:40Z',
published_at_int: new Date(),
safe_processed_html: '<p>Kitsch hoodie artisan.</p>\n\n',
path: '/naoma_dr_rice/comment/n',
username: 'naoma_dr_rice',
name: 'Dr. Naoma Rice',
profile_image_90: '/images/7.png',
},
],
public_reactions_count: 428,
comments_count: 213,
};
export const articleWithReadingTimeGreaterThan1 = {
id: 62407,
title: 'Unbranded Home Loan Account',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 35682,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 23289,
user: {
username: 'Emil99',
name: 'Stella Macejkovic',
profile_image_90: '/images/10.png',
},
published_at_int: 1582037964819,
published_timestamp: 'Tue, 18 Feb 2020 14:59:24 GMT',
published_at: '2020-02-18T14:59:24Z',
readable_publish_date: 'February 18',
top_comments: [],
reading_time: 8,
};
export const videoArticle = {
id: 49020,
title: 'monitor recontextualize',
path: '/some-post/path',
type_of: '',
class_name: 'Article',
flare_tag: {
id: 58676,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 27683,
user: {
username: 'Nova_Luettgen',
name: 'Henri Gibson',
profile_image_90: '/images/10.png',
},
published_at_int: 1582038662478,
published_timestamp: 'Tue, 18 Feb 2020 15:11:02 GMT',
published_at: '2020-02-18T14:59:24Z',
readable_publish_date: 'February 18',
cloudinary_video_url: '/images/apple-icon.png',
main_image: '/images/10.png',
video_duration_in_minutes: 10,
};
export const podcastArticle = {
id: 49020,
title: 'monitor recontextualize',
path: '/some-post/path',
type_of: 'podcast_episodes',
class_name: 'Article',
flare_tag: {
id: 58676,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 27683,
user: {
username: 'Nova_Luettgen',
name: 'Henri Gibson',
profile_image_90: '/images/10.png',
},
published_at_int: 1582038662478,
published_timestamp: 'Tue, 18 Feb 2020 15:11:02 GMT',
published_at: '2020-02-18T15:11:02Z',
readable_publish_date: 'February 18',
podcast: {
slug: 'monitor-recontextualize',
title: 'Rubber local',
image_url: '/images/16.png',
image_90: '/images/16.png',
},
slug: 'episode-slug'
};
export const podcastEpisodeArticle = {
id: 49020,
title: 'monitor recontextualize',
path: '/some-post/path',
type_of: '',
class_name: 'PodcastEpisode',
flare_tag: {
id: 58676,
name: 'javascript',
hotness_score: 99,
points: 23,
bg_color_hex: '#000000',
text_color_hex: '#ffffff',
},
tag_list: ['javascript', 'ruby', 'go'],
cached_tag_list_array: [],
user_id: 27683,
user: {
username: 'Nova_Luettgen',
name: 'Henri Gibson',
profile_image_90: '/images/10.png',
},
published_at_int: 1582038662478,
published_timestamp: 'Tue, 18 Feb 2020 15:11:02 GMT',
published_at: '2020-02-18T15:11:02Z',
readable_publish_date: 'February 18',
};
export const userArticle = {
id: 24692,
title: 'Phyllis Armstrong',
user_id: 7955,
class_name: 'User',
user: {
username: 'phyllis.armstrong',
name: 'Phyllis Armstrong',
profile_image_90: '/images/3.png',
},
};
export const featuredArticle = {
...article,
main_image: '/images/onboarding-background.png',
public_reactions_count: 428,
comments_count: 213,
};
export const featuredArticleWithOrganization = {
...articleWithOrganization,
main_image: '/images/12.png',
};