Skip to content

Commit d8f7516

Browse files
committed
fix: address XO v1 lint errors in Static unmount test
Switch boolean short-circuit to ternary for jsx-no-leaked-render and extract any-typed value before chaining .includes() to satisfy no-unsafe-call.
1 parent 86f7faa commit d8f7516

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/components.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,11 @@ test('no crash after unmounting Static', t => {
475475
function Dynamic({show}: {readonly show: boolean}) {
476476
return (
477477
<Box>
478-
{show && (
478+
{show ? (
479479
<Static items={items}>
480480
{item => <Text key={item}>{item}</Text>}
481481
</Static>
482-
)}
482+
) : null}
483483
<Text>Dynamic</Text>
484484
</Box>
485485
);
@@ -491,7 +491,8 @@ test('no crash after unmounting Static', t => {
491491
});
492492

493493
rerender(<Dynamic show={false} />);
494-
t.true((stdout.write as any).lastCall.args[0].includes('Dynamic'));
494+
const lastOutput = (stdout.write as any).lastCall.args[0] as string;
495+
t.true(lastOutput.includes('Dynamic'));
495496
});
496497

497498
test('render only new items in static output on final render', t => {

0 commit comments

Comments
 (0)