diff --git a/packages/notebook-extension/src/trusted.tsx b/packages/notebook-extension/src/trusted.tsx index 61a1a16d12..37a9bd3b19 100644 --- a/packages/notebook-extension/src/trusted.tsx +++ b/packages/notebook-extension/src/trusted.tsx @@ -17,16 +17,19 @@ const isTrusted = (notebook: Notebook): boolean => { return false; } const cells = Array.from(model.cells); + let total = 0; + let trusted = 0; - const trusted = cells.reduce((accum, current) => { - if (current.trusted) { - return accum + 1; - } else { - return accum; + for (const currentCell of cells) { + if (currentCell.type !== 'code') { + continue; } - }, 0); + total++; + if (currentCell.trusted) { + trusted++; + } + } - const total = cells.length; return trusted === total; }; diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png index b38ce59a7e..3ec3789d54 100644 Binary files a/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png and b/ui-tests/test/general.spec.ts-snapshots/notebook-chromium-linux.png differ diff --git a/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png index e1685bc1f7..5ded949423 100644 Binary files a/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png and b/ui-tests/test/general.spec.ts-snapshots/notebook-firefox-linux.png differ