Skip to content

Commit b506d59

Browse files
committed
Ad test for YouTube playlist URL
1 parent 62aec66 commit b506d59

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

data/conferences/2016/2016-03-28-emberconf-2016.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ conference:
88
- ember
99
-
1010
links:
11-
playlist: https://www.youtube.com/watch?v=OInJBwS8VDQ&list=PLE7tQUdRKcyYzUUTUJ4LwayKH8p5spYvv
11+
playlist: https://www.youtube.com/playlist?list=PLE7tQUdRKcyYzUUTUJ4LwayKH8p5spYvv
1212
twitter: EmberConf
1313
youtube: UCWnPjmqvljcafA0z2U1fwKQ
1414
website: https://2016.emberconf.com/

data/conferences/2018/2018-10-29-confrontjs-2018.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ conference:
88
-
99
-
1010
links:
11-
playlist: https://www.youtube.com/playlist?list=UUmz8kA8ldl1QsH-m4WDVIGA
11+
playlist: https://www.youtube.com/playlist?list=PL-NdCZbM-0-tBj_Vmh4BNJ87jFLgPFBeD
1212
twitter: confrontjs
1313
youtube: UCmz8kA8ldl1QsH-m4WDVIGA
1414
website: https://confrontjs.com/

js/utils/utils-node.js

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module.exports.INFO_STATUS_INCOMPLETE = 'incomplete';
99
module.exports.REGEX_ID_YOUTUBE_CHANNEL =
1010
/^[a-zA-Z0-9_-]{24}$/;
1111

12+
module.exports.REGEX_URL_YOUTUBE_PLAYLIST =
13+
/^https:\/\/www\.youtube\.com\/playlist\?list=([a-zA-Z0-9_-]{34})$/;
14+
1215
// SYNC_REGEX_URL_YOUTUBE
1316
module.exports.REGEX_URL_YOUTUBE =
1417
/^https:\/\/youtu\.be\/([a-zA-Z0-9_-]{11})$/;

test/conferences.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
INFO_STATUS_COMPLETE,
1010
INFO_STATUS_INCOMPLETE,
1111
REGEX_ID_YOUTUBE_CHANNEL,
12+
REGEX_URL_YOUTUBE_PLAYLIST,
1213
REGEX_URL_YOUTUBE,
1314
REGEX_URL_VIMEO,
1415
} = require('../js/utils/utils-node');
@@ -119,6 +120,7 @@ glob.sync(testGlob).forEach(file => {
119120

120121
it('contains valid playlist URL', () => {
121122
conference.links.playlist && expect(conference.links.playlist.match(REGEX_URL)).not.toBeNull();
123+
conference.links.playlist && conference.links.playlist.includes('www.youtube.com') && expect(conference.links.playlist.match(REGEX_URL_YOUTUBE_PLAYLIST)).not.toBeNull();
122124
});
123125

124126
it('contains valid Twitter account ID', () => {

0 commit comments

Comments
 (0)