From 9178488e3cce4a0b4f59f77a642962819fb9a87e Mon Sep 17 00:00:00 2001 From: Kobi Kadosh Date: Wed, 14 Sep 2022 16:21:55 +0300 Subject: [PATCH] add test for helpUrl --- test/__snapshots__/index.test.js.snap | 42 +++++++++++++++++++++++++++ test/config-metadata.yml | 18 ++++++++++++ test/index.test.js | 11 +++++++ 3 files changed, 71 insertions(+) create mode 100644 test/config-metadata.yml diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 2cd31eb..d68dd92 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -383,3 +383,45 @@ Now that you know how to use Velo enable it in one of your sites. Select a Wix S " `; + +exports[`generate readme with metadata 1`] = ` +" +# Learn Velo + + +Velo is a full-stack development platform that empowers you to rapidly build, manage and deploy professional web apps. + +## Course Details + +This is the description we show on the course page [here](https://github.com/wix-academy/learn-velo). This first paragraph will be featured at the top of the page so make it great. +​ + +​ +Be sure to tell the learner about the technology you are teaching, why they should learn it, how they can use it, and what you will teach them. +​ + + +Include information on how they can reach you for questions about the content or course. + +### Help + +[Post on #wix-blocks-help channel](https://wix.slack.com/archives/CKDB50KE2) + +## Steps + + +
+

01 - Welcome to Velo, Wix’s developer mode

+ +Our developer advocate Joshua Alphonse is happy to introduce you to this powerful product so you can start creating your custom solutions. + + +#### Watch the video + +[![Welcome to Velo, Wix’s developer mode](https://img.youtube.com/vi/JyTegNu4MHw/0.jpg)](https://www.youtube.com/watch?v=JyTegNu4MHw \\"Welcome to Velo, Wix’s developer mode\\") + + +👉 [Welcome to Velo, Wix’s developer mode](https://learn-code.wix.com/en/article/about-velo-2466982) +
+" +`; diff --git a/test/config-metadata.yml b/test/config-metadata.yml new file mode 100644 index 0000000..671ae2e --- /dev/null +++ b/test/config-metadata.yml @@ -0,0 +1,18 @@ +title: Learn Velo +description: Velo is a full-stack development platform that empowers you to rapidly build, manage and deploy professional web apps. + +helpText: 'Post on #wix-blocks-help channel' +helpUrl: https://wix.slack.com/archives/CKDB50KE2 + +tags: + - Wix Blocks + - BoB + - JavaScript + - Hands-on + +steps: + - title: 'Welcome to Velo, Wix’s developer mode' + link: 'https://learn-code.wix.com/en/article/about-velo-2466982' + video: 'https://youtube.com/embed/JyTegNu4MHw' + description: >- + Our developer advocate Joshua Alphonse is happy to introduce you to this powerful product so you can start creating your custom solutions. \ No newline at end of file diff --git a/test/index.test.js b/test/index.test.js index 8206074..65b833d 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -31,6 +31,17 @@ test("generate readme", async () => { expect(readme).toMatchSnapshot(); }); +test('generate readme with metadata', async () => { + const readmeWithMetadata = await generateReadmeFromConfig( + "config-metadata.yml", + "course-details.md", + "out/readme-metadata.md", + "test/", + ); + + expect(readmeWithMetadata).toMatchSnapshot(); +}) + test('extractYTVidfromUrl', () => { expect(extractYTVidfromUrl('https://www.youtube.com/embed/ISAplsTsIOE')).toBe('ISAplsTsIOE') expect(extractYTVidfromUrl('https://www.youtube.com/embed/ISAplsTsIOE/')).toBe('ISAplsTsIOE')