okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
334dde73a
main
1/** Item 3: the tool rows in a chat are compact lines with no divider between them (they used to inherit the settings disclosure's top border and 18px padding). */ 2import test from 'node:test' ; 3import assert from 'node:assert/strict' ; 4import { readFile } from 'node:fs/promises' ; 5 6const css = await readFile ( new URL ( '../src/styles/app.css' , import . meta. url ), 'utf8' ); 7function lastRule ( selector ) { 8const at = css . lastIndexOf ( `\n ${ selector } {` ); 9if ( at < 0 ) return '' ; 10return css . slice ( at , css . indexOf ( '}' , at )); 11} 12 13test ( 'a tool row has no top border and little padding' , () => { 14const rule = lastRule ( '.tool-summary' ); 15assert . match ( rule , / border-top:\s * 0 / ); 16const pad = / padding-block:\s * ( \d + ) px / . exec ( rule ); 17assert . ok ( pad && Number ( pad [ 1 ]) <= 4 , `padding-block ${ pad ?.[ 1 ]} ` ); 18}); 19 20test ( 'the chat renders tool rows as a disclosure that the compact rule overrides' , async () => { 21const chat = await readFile ( new URL ( '../src/screens/Chat.tsx' , import . meta. url ), 'utf8' ); 22assert . match ( chat , / className="disclosure tool-summary" / ); 23});