Skip to content

Commit

Permalink
Merge pull request #3912 from preactjs/fix-ie11-test
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Feb 24, 2023
2 parents 8ff0e53 + 3674c42 commit ca31f13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion compat/test/browser/textarea.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ describe('Textarea', () => {
act(() => {
set('');
});
expect(scratch.innerHTML).to.equal('<textarea></textarea>');
// Same as earlier: IE11 always displays the value as node.innerHTML
if (!/Trident/.test(window.navigator.userAgent)) {
expect(scratch.innerHTML).to.equal('<textarea></textarea>');
}
expect(scratch.firstElementChild.value).to.equal('');
});
});
11 changes: 7 additions & 4 deletions test/browser/render.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ describe('render()', () => {
expect(scratch.innerHTML).to.eql(`<img width="100%" height="100%">`);
});

it('should render px width and height on img correctly', () => {
render(<img width="100px" height="100px" />, scratch);
expect(scratch.innerHTML).to.eql(`<img width="100px" height="100px">`);
});
// IE11 doesn't support these.
if (/Trident/.test(window.navigator.userAgent)) {
it('should render px width and height on img correctly', () => {
render(<img width="100px" height="100px" />, scratch);
expect(scratch.innerHTML).to.eql(`<img width="100px" height="100px">`);
});
}

it('should not render when detecting JSON-injection', () => {
const vnode = JSON.parse('{"type":"span","children":"Malicious"}');
Expand Down

0 comments on commit ca31f13

Please sign in to comment.