/
githubmirror
/
preact
Обзор
Документация
Войти
/
githubmirror
/
preact
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
compat/test/browser/select.test.jsx
33 строки
841 B
Ryan Christian
test: Switch tests to use `.jsx` file extension (#4925)
29 сен 2025, 16:58
Не верифицирован
29 сен 2025, 16:58
8e3e4ce
Код
Авторство
О чём код?
import { setupScratch, teardown } from '../../../test/_util/helpers'; import { createElement, render } from 'preact/compat'; describe('Select', () => { let scratch; beforeEach(() => { scratch = setupScratch(); }); afterEach(() => { teardown(scratch); }); it('should work with multiple selected (array of values)', () => { function App() { return ( <select multiple value={['B', 'C']}> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> ); } render(<App />, scratch); const options = scratch.firstChild.children; expect(options[0]).to.have.property('selected', false); expect(options[1]).to.have.property('selected', true); expect(options[2]).to.have.property('selected', true); expect(scratch.firstChild.value).to.equal('B'); }); });