Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions public/templates/about-us-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ <h1>
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand Down
2 changes: 2 additions & 0 deletions public/templates/cover-template.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script type="x-tmpl-mustache">
<div class="content-container">
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}

<div class="content">
<h1>{{{ title }}}</h1>
Expand Down
2 changes: 2 additions & 0 deletions public/templates/title-content-image-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ <h1>
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand Down
2 changes: 2 additions & 0 deletions public/templates/title-content-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ <h1>
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand Down
36 changes: 36 additions & 0 deletions tests/unit/App.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ let mockServerUrl = 'https://localhost:9200'
const templateHtmlMap: Record<string, string> = {
'cover-template.html': `<script type="x-tmpl-mustache">
<div class="content-container">
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}

<div class="content">
<h1>{{{ title }}}</h1>
Expand All @@ -45,9 +47,11 @@ By: {{{ metadata.presenter }}}
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand All @@ -73,9 +77,11 @@ By: {{{ metadata.presenter }}}
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand All @@ -101,9 +107,11 @@ By: {{{ metadata.presenter }}}
{{{ title }}}

</h1>
{{#metadata.logo}}
<div class="logo">
<img src="{{{ metadata.logo }}}" alt="Logo">
</div>
{{/metadata.logo}}
</div>

<div class="content-wrapper">
Expand Down Expand Up @@ -410,6 +418,34 @@ aboutUs:
# About Us ::slide:about-us

Some content about us.
`)
const vm = getWrapper()
await flushPromises()
await vi.waitFor(
() => {
expect(vm.classes('md-template')).toBe(true)
},
{ timeout: 1000 }
)
expect(vm.find('.reveal .slides').html()).toMatchSnapshot()
})

it('should render title content template without the logo', async () => {
global.fetch = createFetchMock(`---
slide: title-content
presenter: John Doe
---
# Title Content Slide

- Introduction to mountain ecosystems
- Basic concepts of quantum encryption
- Exploring culinary traditions in Southeast Asia
- Overview of blockchain consensus mechanisms
- Setting up a personal productivity system
- Writing clean, maintainable JavaScript code
- Understanding modern art movements
- History of aviation and early flight experiments
- Managing team dynamics in remote work
`)
const vm = getWrapper()
await flushPromises()
Expand Down
37 changes: 37 additions & 0 deletions tests/unit/__snapshots__/App.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,40 @@ exports[`Template Features > should render title content template 1`] = `
</section>
</div>"
`;

exports[`Template Features > should render title content template without the logo 1`] = `
"<div id="slideContainer" class="slides" style="width: 960px; height: 700px; left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%) scale(0.2);">
<section class="title-content present" data-markdown="" data-markdown-parsed="true" style="top: 350px; display: block;">
<div class="content-container">
<div class="title">
<h1>

<p>Title Content Slide</p>
</h1>
</div>

<div class="content-wrapper">
<div class="content">

<ul>
<li>Introduction to mountain ecosystems</li>
<li>Basic concepts of quantum encryption</li>
<li>Exploring culinary traditions in Southeast Asia</li>
<li>Overview of blockchain consensus mechanisms</li>
<li>Setting up a personal productivity system</li>
<li>Writing clean, maintainable JavaScript code</li>
<li>Understanding modern art movements</li>
<li>History of aviation and early flight experiments</li>
<li>Managing team dynamics in remote work</li>
</ul>
</div>
</div>
</div>
<footer>
<div class="footer-content"></div>
<div class="custom-slide-number">1</div>
</footer>

</section>
</div>"
`;
Loading