feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run
Some checks are pending
Qualité / tests (push) Waiting to run
This commit is contained in:
17
frontend/tests/inlineImages.test.ts
Normal file
17
frontend/tests/inlineImages.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import {readFileSync} from 'node:fs'
|
||||
import test from 'node:test'
|
||||
|
||||
const common=readFileSync(new URL('../src/Common.tsx',import.meta.url),'utf8')
|
||||
const styles=readFileSync(new URL('../src/styles.css',import.meta.url),'utf8')
|
||||
|
||||
test('inline chat images load eagerly inside the iOS scroll container',()=>{
|
||||
assert.match(common,/className="markdown-image"[\s\S]*loading="eager"/)
|
||||
assert.doesNotMatch(common,/className="markdown-image"[\s\S]*loading="lazy"/)
|
||||
})
|
||||
|
||||
test('inline chat images reserve a visible panoramic area before decoding',()=>{
|
||||
const rule=styles.match(/\.markdown-image>img\{([^}]*)\}/)?.[1]||''
|
||||
assert.match(rule,/aspect-ratio:auto 16\/9/)
|
||||
assert.match(rule,/min-height:160px/)
|
||||
})
|
||||
Reference in New Issue
Block a user