Skip to content

Commit

Permalink
add test for helpUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
wildcard committed Sep 14, 2022
1 parent 69b0107 commit 9178488
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,45 @@ Now that you know how to use Velo enable it in one of your sites. Select a Wix S
</details>
"
`;

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
<details id=X open>
<summary><h2>01 - Welcome to Velo, Wix’s developer mode</h2></summary>
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)
</details>
"
`;
18 changes: 18 additions & 0 deletions test/config-metadata.yml
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 11 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 9178488

Please sign in to comment.