Skip to content

Commit 13a67d1

Browse files
committed
test: raw tag in switch
1 parent 58c285a commit 13a67d1

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

test/expect/raw_in_switch.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Hello from Earth, {{ username }}
2+
3+
4+
5+
Hello from Moscow, {{ username }}

test/fixtures/raw_in_switch.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<switch expression="country">
2+
<case n="'russia'">
3+
<p>Hello, from Russia!</p>
4+
</case>
5+
<default>
6+
<raw>Hello from Earth, {{ username }}</raw>
7+
</default>
8+
</switch>
9+
10+
<switch expression="city">
11+
<case n="'moscow'">
12+
<raw>Hello from Moscow, {{ username }}</raw>
13+
</case>
14+
<default>
15+
<p>Hello, from Earth!</p>
16+
</default>
17+
</switch>

test/test-switch.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ test('Switch - bad flow', (t) => {
9090
t.is(err.message, 'the "switch" tag can contain only "case" tags and one "default" tag')
9191
})
9292
})
93+
94+
test('Switch - raw tag', (t) => {
95+
return Promise.all([
96+
process(t, 'raw_in_switch', { locals: { country: 'germany', city: 'moscow' } })
97+
])
98+
})

0 commit comments

Comments
 (0)