Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrishnan8594 committed Apr 14, 2021
1 parent 1fd4775 commit b1f64ed
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions dist/player.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ var Player = /*#__PURE__*/function () {
if (_this5.element && _this5.element.nodeName === 'IFRAME' && _this5.element.parentNode) {
// If we've added an additional wrapper div, remove that from the DOM.
// If not, just remove the iframe element.
if (_this5._originalElement !== _this5.element.parentNode) {
if (_this5._originalElement !== _this5.element.parentNode && _this5.element.parentNode.parentNode) {
_this5.element.parentNode.parentNode.removeChild(_this5.element.parentNode);
} else {
_this5.element.parentNode.removeChild(_this5.element);
Expand All @@ -1745,7 +1745,7 @@ var Player = /*#__PURE__*/function () {
if (iframe && iframe.parentNode) {
// If we've added an additional wrapper div, remove that from the DOM.
// If not, just remove the iframe element.
if (_this5._originalElement !== iframe.parentNode) {
if (_this5._originalElement !== iframe.parentNode && iframe.parentNode.parentNode) {
iframe.parentNode.parentNode.removeChild(iframe.parentNode);
} else {
iframe.parentNode.removeChild(iframe);
Expand Down
4 changes: 2 additions & 2 deletions dist/player.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/player.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/player.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/player.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class Player {
if (this.element && this.element.nodeName === 'IFRAME' && this.element.parentNode) {
// If we've added an additional wrapper div, remove that from the DOM.
// If not, just remove the iframe element.
if (this._originalElement !== this.element.parentNode) {
if (this._originalElement !== this.element.parentNode && this.element.parentNode.parentNode) {
this.element.parentNode.parentNode.removeChild(this.element.parentNode);
} else {
this.element.parentNode.removeChild(this.element);
Expand All @@ -564,7 +564,7 @@ class Player {
if (iframe && iframe.parentNode) {
// If we've added an additional wrapper div, remove that from the DOM.
// If not, just remove the iframe element.
if (this._originalElement !== iframe.parentNode) {
if (this._originalElement !== iframe.parentNode && iframe.parentNode.parentNode) {
iframe.parentNode.parentNode.removeChild(iframe.parentNode);
} else {
iframe.parentNode.removeChild(iframe);
Expand Down
4 changes: 2 additions & 2 deletions test/embed-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test('getOEmbedData doesn’t operate on non-Vimeo urls', async (t) => {

test('getOEmbedData returns a json oembed response', async (t) => {
t.plan(2);
const result = await getOEmbedData('https://player.vimeo.com/video/18');
const result = await getOEmbedData('https://player.vimeo.com/video/336812660');
t.is(typeof result, 'object');
t.is(result.type, 'video');
});
Expand Down Expand Up @@ -65,7 +65,7 @@ test('createEmbed returns the iframe from a responsive embed', (t) => {
});

test('initializeEmbeds should create embeds', async (t) => {
const div = html`<div data-vimeo-id="18" data-vimeo-width="640" id="handstick"></div>`;
const div = html`<div data-vimeo-id="336812660" data-vimeo-width="640" id="handstick"></div>`;
document.body.appendChild(div);

await new Promise((resolve, reject) => {
Expand Down

0 comments on commit b1f64ed

Please sign in to comment.