HTMLElement.test.js 485 B

12345678910111213141516171819
  1. import { loadEnv } from './vm'
  2. import HTMLElement from '../src/HTMLElement'
  3. describe('HTMLElement', () => {
  4. it('return clientHeight', () => {
  5. const div = new HTMLElement('div')
  6. div.style.fontSize = '14px'
  7. expect(div.clientHeight).toEqual(14)
  8. })
  9. it('return clientWidth', () => {
  10. const div = new HTMLElement('div')
  11. div.style.fontSize = '14px'
  12. expect(div.clientWidth).toEqual(0)
  13. div.innerHTML = 'hello'
  14. expect(div.clientWidth).toEqual(70)
  15. })
  16. })