Skip to content

Commit 4f0afe3

Browse files
committed
make copilot happy
1 parent ccaaab8 commit 4f0afe3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/compass-components/src/components/drawer-portal.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ describe('DrawerSection', function () {
230230
});
231231

232232
it('renders guide cue when passed in props', async function () {
233+
localStorage.compass_guide_cues = '[]';
233234
function TestDrawer() {
234235
return (
235236
<DrawerContentProvider>

packages/compass-components/src/components/drawer-portal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,15 @@ export const DrawerAnchor: React.FunctionComponent = ({ children }) => {
296296
} else {
297297
// we don't re-render enough times for unit tests to pass and this
298298
// forces it to keep re-trying until the node is found
299-
setFailedLookupCount((c) => c + 1);
299+
if (failedLookupCount < 10) {
300+
setFailedLookupCount((c) => c + 1);
301+
}
300302
}
301303
}
302304

303305
setAssistantNodes((oldNodes) => {
304-
for (const id of Object.keys({ ...nodes, oldNodes })) {
306+
// account for removed nodes by checking all keys of both old and new
307+
for (const id of Object.keys({ ...oldNodes, ...nodes })) {
305308
if (nodes[id] !== oldNodes[id]) {
306309
return nodes;
307310
}

0 commit comments

Comments
 (0)