mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-14 09:04:50 +02:00
Adapting to changes to JSDOM
This commit is contained in:
@@ -9,8 +9,7 @@ beforeAll(() => {
|
|||||||
test('Click nav plugin', () => {
|
test('Click nav plugin', () => {
|
||||||
const next = jest.fn();
|
const next = jest.fn();
|
||||||
const ws = document.getElementById('webslides');
|
const ws = document.getElementById('webslides');
|
||||||
// Simulates dataset
|
|
||||||
ws.dataset = {};
|
|
||||||
const webslides = {
|
const webslides = {
|
||||||
options: {
|
options: {
|
||||||
changeOnClick: true
|
changeOnClick: true
|
||||||
|
@@ -44,10 +44,10 @@ test('YouTube utility', () => {
|
|||||||
new YouTube(webslides);
|
new YouTube(webslides);
|
||||||
|
|
||||||
expect(typeof window.onYouTubeIframeAPIReady).toBe('function');
|
expect(typeof window.onYouTubeIframeAPIReady).toBe('function');
|
||||||
webslides.el.querySelector('[data-youtube]').dataset = {
|
const el = webslides.el.querySelector('[data-youtube]');
|
||||||
autoplay: true,
|
|
||||||
youtubeId: 'CQY3KUR3VzM'
|
el.dataset.autoplay = true;
|
||||||
};
|
el.dataset.youtubeId = 'CQY3KUR3VzM';
|
||||||
|
|
||||||
window.onYouTubeIframeAPIReady();
|
window.onYouTubeIframeAPIReady();
|
||||||
|
|
||||||
|
@@ -8,8 +8,8 @@ describe('Hash utility', () => {
|
|||||||
document.location.hash = '#slide=1';
|
document.location.hash = '#slide=1';
|
||||||
const goto = jest.fn();
|
const goto = jest.fn();
|
||||||
const ws = document.getElementById('webslides');
|
const ws = document.getElementById('webslides');
|
||||||
// Simulates dataset
|
|
||||||
ws.dataset = {};
|
|
||||||
const webslides = {
|
const webslides = {
|
||||||
options: {
|
options: {
|
||||||
changeOnClick: true
|
changeOnClick: true
|
||||||
|
Reference in New Issue
Block a user