forked from tildeio/htmlbars
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Adds the ability to blacklist props that should use setAttri…
…bute because of browser compliance issues, fixes emberjs/ember.js#11112
- Loading branch information
Showing
2 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { normalizeProperty } from 'dom-helper/prop'; | ||
|
||
QUnit.module('dom-helper prop'); | ||
|
||
test('returns `undefined` for special element properties that are non-compliant in certain browsers', function() { | ||
expect(1); | ||
|
||
var badPairs = [{ tagName: 'BUTTON', key: 'type' }]; | ||
|
||
badPairs.forEach(function (pair) { | ||
var element = { | ||
tagName: pair.tagName | ||
}; | ||
|
||
Object.defineProperty(element, pair.key, { | ||
set: function () { | ||
throw new Error('I am a bad browser!'); | ||
} | ||
}); | ||
|
||
var actual = normalizeProperty(element, pair.key); | ||
equal(actual, undefined); | ||
}); | ||
}); |