Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions patch.diff

This file was deleted.

24 changes: 24 additions & 0 deletions tests/docx-embed-loader.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,27 @@ test('registerDocxFileEmbed catches and logs errors during registration', async
const result = registerDocxFileEmbed(plugin, () => undefined);
assert.equal(result, false);
});

test('processDocxEmbeds adds DocxEmbedScanChild to context', async () => {
const { processDocxEmbeds } = await loadDocxEmbedLoaderModule();

let childAdded = null;
const ctx = {
addChild: (child) => {
childAdded = child;
}
};

const app = {};
const el = {
ownerDocument: {
defaultView: { setTimeout, clearTimeout }
}
};

processDocxEmbeds(app, el, ctx, () => undefined);

assert.ok(childAdded);
assert.equal(typeof childAdded.onload, 'function');
assert.equal(typeof childAdded.onunload, 'function');
});
Loading
Loading