(apiType: 'classic' | 'composition')
| 71 | } |
| 72 | |
| 73 | async function testSvg(apiType: 'classic' | 'composition') { |
| 74 | const baseUrl = `file://${path.resolve( |
| 75 | __dirname, |
| 76 | `../../examples/${apiType}/svg.html`, |
| 77 | )}` |
| 78 | |
| 79 | await page().goto(baseUrl) |
| 80 | await page().waitForSelector('svg') |
| 81 | expect(await count('g')).toBe(1) |
| 82 | expect(await count('polygon')).toBe(1) |
| 83 | expect(await count('circle')).toBe(1) |
| 84 | expect(await count('text')).toBe(6) |
| 85 | expect(await count('label')).toBe(6) |
| 86 | expect(await count('button')).toBe(7) |
| 87 | expect(await count('input[type="range"]')).toBe(6) |
| 88 | await assertPolygon(6) |
| 89 | await assertLabels(6) |
| 90 | await assertStats([100, 100, 100, 100, 100, 100]) |
| 91 | |
| 92 | await setValue(nthRange(1), '10') |
| 93 | await assertPolygon(6) |
| 94 | await assertLabels(6) |
| 95 | await assertStats([10, 100, 100, 100, 100, 100]) |
| 96 | |
| 97 | await click('button.remove') |
| 98 | expect(await count('text')).toBe(5) |
| 99 | expect(await count('label')).toBe(5) |
| 100 | expect(await count('button')).toBe(6) |
| 101 | expect(await count('input[type="range"]')).toBe(5) |
| 102 | await assertPolygon(5) |
| 103 | await assertLabels(5) |
| 104 | await assertStats([100, 100, 100, 100, 100]) |
| 105 | |
| 106 | await typeValue('input[name="newlabel"]', 'foo') |
| 107 | await click('#add > button') |
| 108 | expect(await count('text')).toBe(6) |
| 109 | expect(await count('label')).toBe(6) |
| 110 | expect(await count('button')).toBe(7) |
| 111 | expect(await count('input[type="range"]')).toBe(6) |
| 112 | await assertPolygon(6) |
| 113 | await assertLabels(6) |
| 114 | await assertStats([100, 100, 100, 100, 100, 100]) |
| 115 | |
| 116 | await setValue(nthRange(1), '10') |
| 117 | await assertPolygon(6) |
| 118 | await assertLabels(6) |
| 119 | await assertStats([10, 100, 100, 100, 100, 100]) |
| 120 | |
| 121 | await setValue(nthRange(2), '20') |
| 122 | await assertPolygon(6) |
| 123 | await assertLabels(6) |
| 124 | await assertStats([10, 20, 100, 100, 100, 100]) |
| 125 | |
| 126 | await setValue(nthRange(6), '60') |
| 127 | await assertPolygon(6) |
| 128 | await assertLabels(6) |
| 129 | await assertStats([10, 20, 100, 100, 100, 60]) |
| 130 |
no test coverage detected