|
1 | 1 | import { resetMouse, sendKeys, sendMouseToElement } from '@vaadin/test-runner-commands';
|
2 | 2 | import { fixtureSync, mousedown } from '@vaadin/testing-helpers';
|
3 | 3 | import { visualDiff } from '@web/test-runner-visual-regression';
|
| 4 | +import '@vaadin/icon/src/vaadin-icon.js'; |
| 5 | +import '@vaadin/icons/vaadin-iconset.js'; |
4 | 6 | import '../../../src/vaadin-button.js';
|
5 | 7 |
|
6 | 8 | describe('button', () => {
|
@@ -50,4 +52,25 @@ describe('button', () => {
|
50 | 52 | });
|
51 | 53 | });
|
52 | 54 | });
|
| 55 | + |
| 56 | + describe('icon', () => { |
| 57 | + const PREFIX_ICON = '<vaadin-icon icon="vaadin:reply" slot="prefix"></vaadin-icon>'; |
| 58 | + const SUFFIX_ICON = '<vaadin-icon icon="vaadin:reply" slot="suffix"></vaadin-icon>'; |
| 59 | + |
| 60 | + it('before text', async () => { |
| 61 | + element.insertAdjacentHTML('afterbegin', PREFIX_ICON); |
| 62 | + await visualDiff(div, 'icon-before-text'); |
| 63 | + }); |
| 64 | + |
| 65 | + it('after text', async () => { |
| 66 | + element.insertAdjacentHTML('beforeend', SUFFIX_ICON); |
| 67 | + await visualDiff(div, 'icon-after-text'); |
| 68 | + }); |
| 69 | + |
| 70 | + it('without text', async () => { |
| 71 | + element.textContent = ''; |
| 72 | + element.insertAdjacentHTML('afterbegin', PREFIX_ICON); |
| 73 | + await visualDiff(div, 'icon-without-text'); |
| 74 | + }); |
| 75 | + }); |
53 | 76 | });
|
0 commit comments