Test constructor did run
This commit is contained in:
Родитель
530e22dc01
Коммит
ae7bad8a60
|
@ -1,5 +1,9 @@
|
|||
suite("FlagIcon", function() {
|
||||
class FlagIcon extends HTMLElement {
|
||||
constructor() {
|
||||
super()
|
||||
this._constructorDidRun = true
|
||||
}
|
||||
}
|
||||
customElements.define("flag-icon", FlagIcon)
|
||||
|
||||
|
@ -8,6 +12,7 @@ suite("FlagIcon", function() {
|
|||
chai.assert(icon instanceof HTMLElement)
|
||||
chai.assert(icon instanceof FlagIcon)
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON")
|
||||
chai.assert.equal(icon._constructorDidRun, true)
|
||||
})
|
||||
|
||||
test("constructor", function() {
|
||||
|
@ -15,6 +20,7 @@ suite("FlagIcon", function() {
|
|||
chai.assert(icon instanceof HTMLElement)
|
||||
chai.assert(icon instanceof FlagIcon)
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON")
|
||||
chai.assert.equal(icon._constructorDidRun, true)
|
||||
})
|
||||
|
||||
test("innerHTML", function() {
|
||||
|
@ -25,5 +31,6 @@ suite("FlagIcon", function() {
|
|||
chai.assert(icon instanceof HTMLElement)
|
||||
chai.assert(icon instanceof FlagIcon)
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON")
|
||||
chai.assert.equal(icon._constructorDidRun, true)
|
||||
})
|
||||
})
|
||||
|
|
|
@ -18,7 +18,10 @@ suite("FlagIcon", function () {
|
|||
function FlagIcon() {
|
||||
_classCallCheck(this, FlagIcon);
|
||||
|
||||
return _possibleConstructorReturn(this, (FlagIcon.__proto__ || Object.getPrototypeOf(FlagIcon)).apply(this, arguments));
|
||||
var _this = _possibleConstructorReturn(this, (FlagIcon.__proto__ || Object.getPrototypeOf(FlagIcon)).call(this));
|
||||
|
||||
_this._constructorDidRun = true;
|
||||
return _this;
|
||||
}
|
||||
|
||||
return FlagIcon;
|
||||
|
@ -31,6 +34,7 @@ suite("FlagIcon", function () {
|
|||
chai.assert(icon instanceof HTMLElement);
|
||||
chai.assert(icon instanceof FlagIcon);
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON");
|
||||
chai.assert.equal(icon._constructorDidRun, true);
|
||||
});
|
||||
|
||||
test("constructor", function () {
|
||||
|
@ -38,6 +42,7 @@ suite("FlagIcon", function () {
|
|||
chai.assert(icon instanceof HTMLElement);
|
||||
chai.assert(icon instanceof FlagIcon);
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON");
|
||||
chai.assert.equal(icon._constructorDidRun, true);
|
||||
});
|
||||
|
||||
test("innerHTML", function () {
|
||||
|
@ -48,5 +53,6 @@ suite("FlagIcon", function () {
|
|||
chai.assert(icon instanceof HTMLElement);
|
||||
chai.assert(icon instanceof FlagIcon);
|
||||
chai.assert.equal(icon.tagName, "FLAG-ICON");
|
||||
chai.assert.equal(icon._constructorDidRun, true);
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче