Skip to content

Commit 35cb0be

Browse files
committed
refactor(ArgumentConverter.test.ts): add decimal value to json -> html test case
1 parent 8722d1c commit 35cb0be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/ArgumentConverter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ it('convert to primitive with a null argument', () => {
3737

3838
// Tests that convertToPrimitive returns string value and isHtml property is true when an object or array argument is passed
3939
it('converts json to html without formatting issues', () => {
40-
const arg = ['foo', 'bar', 123, { A: 123 }, null];
40+
const arg = ['foo', 'bar', 123, 0.123, { A: 123 }, null];
4141
const result = ArgumentConverter.convertToPrimitive(arg);
4242

4343
expect(result.value).toBe(
44-
'<code style="font-size: 0.8rem!important;" class=""><code style="font-size: 0.8rem!important;" class="bold text-gray-500 p-0">&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-orange-400">[</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"foo"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"bar"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;123<span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-yellow-600">Object</span>&nbsp;<code style="font-size: 0.8rem!important;" class="text-gray-600"><span style="font-size: 0.8rem!important;" class="bold text-orange-400">{</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"A"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">:&nbsp;</span>123<span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-orange-400">}</span></code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-indigo-600">null</span><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br><span style="font-size: 0.8rem!important;" class="bold text-orange-400">]</span></code></code>',
44+
'<code style="font-size: 0.8rem!important;" class=""><code style="font-size: 0.8rem!important;" class="bold text-gray-500 p-0">&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-orange-400">[</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"foo"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"bar"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;123<span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;0.123<span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-yellow-600">Object</span>&nbsp;<code style="font-size: 0.8rem!important;" class="text-gray-600"><span style="font-size: 0.8rem!important;" class="bold text-orange-400">{</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code style="font-size: 0.8rem!important;" class="bold text-green-600 p-0">"A"</code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">:&nbsp;</span>123<span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-orange-400">}</span></code><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 0.8rem!important;" class="bold text-indigo-600">null</span><span style="font-size: 0.8rem!important;" class="bold text-orange-400">,</span><br><span style="font-size: 0.8rem!important;" class="bold text-orange-400">]</span></code></code>',
4545
);
4646
expect(result.isHtml).toBe(true);
4747
});

0 commit comments

Comments
 (0)