
[10:41 AM, Tuesday] Alex: did you see the draft - -You: yep - -Alex: are you free now? - -You (replying to Alex: -are you free now?): -i'm at the office - -Alex: sounds good - -[10:44 AM, Tuesday] You: -sorry!-
DM2Text copies part of an Instagram Direct conversation diff --git a/website/tests/site-output.test.mjs b/website/tests/site-output.test.mjs index f41a133..2be2c24 100644 --- a/website/tests/site-output.test.mjs +++ b/website/tests/site-output.test.mjs @@ -53,14 +53,36 @@ test('home matches the reference product presentation', async () => { const visible = text(html); assert.match(html, /href="\/privacy\/"/); assert.match(html, /https:\/\/github\.com\/postigodev\/dm2text/); - assert.match(html, /src="\/marketing\/dm-example\.png"/); + assert.match(html, /data-dm2text-demo/); + assert.match(html, /data-message-count="156"/); + assert.match(html, /data-copy-context/); + assert.match(html, /data-unsend/); + assert.match(html, /data-composer/); + assert.match(html, /data-add-photo/); + assert.match(html, /data-add-reel/); + assert.match(html, /data-message-template="text"/); + assert.match(html, /data-message-template="media"/); + assert.match(html, /data-message-template="shared-post"/); + assert.match(html, /data-count-input/); + assert.match(html, /data-paste-zone/); + assert.match(html, /navigator\.clipboard\?\.writeText/); + assert.doesNotMatch(html, /src="\/marketing\/dm-example\.png"/); + assert.doesNotMatch(html, /images\.unsplash\.com/); assert.match(html, /src="\/brand\/google-chrome\.svg"/); assert.match( html, /href="https:\/\/chromewebstore\.google\.com\/detail\/dm2text\/gpedpddbcooaomkehnmpcjjghnbknpbd"/, ); + assert.match(visible, /clara\.zk Clara Z\./); + assert.match(visible, /Tuesday 9:18 AM .*did you export the new version/); + assert.match(html, /data-text="professional operation we're running here"/); + assert.match(visible, /Swiss posters from the 1970s/); + assert.match(visible, /Wednesday 8:03 AM .*awake\?/); + assert.match(visible, /you absolutely know/); assert.match(visible, /Copy context/); - assert.match(visible, /clipboard\.txt plain text/); + assert.match(visible, /Messages to include/); + assert.match(visible, /pasteboard\.txt plain text/); + assert.match(visible, /Nothing is inserted here automatically\./); assert.match( visible, /copies part of an Instagram Direct conversation as plain text/, @@ -116,7 +138,7 @@ test('pages preserve canonical metadata and avoid hydration', async () => { ); }); -test('build includes local brand and marketing assets', async () => { +test('build includes local brand and unique demo media assets', async () => { for (const path of [ 'brand/dm2text-mark.svg', 'brand/google-chrome.svg', @@ -124,6 +146,33 @@ test('build includes local brand and marketing assets', async () => { 'brand/icon-96.png', 'brand/icon-128.png', 'marketing/dm-example.png', + 'demo/clara-z.webp', + 'demo/poster-mockup.webp', + 'demo/finished-poster.webp', + 'demo/printed-posters.webp', + 'demo/swiss-posters-reel.webp', + 'demo/archival-flyer.webp', + 'demo/cat-keyboard-reel.webp', + 'demo/composer-photo.webp', + 'demo/composer-reel.webp', ]) await access(pageUrl(path)); }); + +test('canonical seeded media uses one distinct local asset per event', async () => { + const html = await readFile(pageUrl('index.html'), 'utf8'); + const seededAssets = [ + 'poster-mockup.webp', + 'finished-poster.webp', + 'printed-posters.webp', + 'swiss-posters-reel.webp', + 'archival-flyer.webp', + 'cat-keyboard-reel.webp', + ]; + + for (const asset of seededAssets) { + assert.equal(html.match(new RegExp(`/demo/${asset}`, 'g'))?.length, 1); + } + assert.match(html, /data-source="design\.archive"/); + assert.match(html, /data-source="catworkers"/); +});