20 lines
834 B
JavaScript
20 lines
834 B
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
isLongImageDownloadRequest,
|
|
LONG_IMAGE_EXPORT_STYLE,
|
|
} from './mindspace-long-image.mjs';
|
|
|
|
test('recognizes supported long-image download query values', () => {
|
|
assert.equal(isLongImageDownloadRequest({ download: 'long-image' }), true);
|
|
assert.equal(isLongImageDownloadRequest({ export: 'png' }), true);
|
|
assert.equal(isLongImageDownloadRequest({ download: 'document' }), false);
|
|
});
|
|
|
|
test('long-image capture style hides platform page actions', () => {
|
|
assert.match(LONG_IMAGE_EXPORT_STYLE, /\[data-mindspace-public-share\]/);
|
|
assert.match(LONG_IMAGE_EXPORT_STYLE, /\.publication-share-fab/);
|
|
assert.match(LONG_IMAGE_EXPORT_STYLE, /\.publication-share-sheet/);
|
|
assert.match(LONG_IMAGE_EXPORT_STYLE, /display:\s*none\s*!important/);
|
|
});
|