Skip to content

Commit 99b2027

Browse files
committed
Add test for coloured square brackets
1 parent bdd63e0 commit 99b2027

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/routes/+page.svelte

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ let depth = 0
107107
</div>
108108
</section>
109109

110+
<section>
111+
<h1>Test red square brackets</h1>
112+
<div class="wrap" id="red_square">
113+
<JsonView json={fixture[0]} --jsonBracketColor="blue" />
114+
</div>
115+
</section>
116+
110117
<style>
111118
section {
112119
margin: 0 0 4rem 0;
@@ -118,4 +125,7 @@ section {
118125
font-size: 0.875rem;
119126
color: #374151;
120127
}
128+
#red_square :global(.isArray) {
129+
color: red;
130+
}
121131
</style>

tests/basic.test.js renamed to tests/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,12 @@ test('special types', async ({ page }) => {
2626
expect(list[a]).toStrictEqual(asserts[a])
2727
}
2828
})
29+
30+
test('red square brackets', async ({ page }) => {
31+
await page.goto('/')
32+
await expect(page.locator('#red_square ._jsonBkt').first()).toHaveCSS('color', 'rgb(0, 0, 255)')
33+
await expect(page.locator('#red_square ._jsonBkt.isArray').first()).toHaveCSS(
34+
'color',
35+
'rgb(255, 0, 0)'
36+
)
37+
})

0 commit comments

Comments
 (0)