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