Skip to content

Commit 32497f1

Browse files
committed
chore: ignore trivial lines of code
1 parent edd9d5a commit 32497f1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/library-authoring/components/ComponentRemover.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const ComponentRemover = ({ usageKey, index, close }: Props) => {
4444
}
4545

4646
const restoreComponent = () => {
47+
// istanbul ignore if: this should never happen
4748
if (!childrenUsageIds) {
4849
return;
4950
}
@@ -86,6 +87,7 @@ const ComponentRemover = ({ usageKey, index, close }: Props) => {
8687
}
8788
const updatedKeys = childrenUsageIds.filter((childId, idx) => childId !== usageKey || idx !== index);
8889
updateContainerChildrenMutation.mutateAsync(updatedKeys).then(() => {
90+
// istanbul ignore if
8991
if (sidebarItemInfo?.id === usageKey && sidebarItemInfo?.index === index) {
9092
// Close sidebar if current component is open
9193
closeLibrarySidebar();

src/library-authoring/containers/ContainerRemover.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ const ContainerRemover = ({
6363
if (hasDuplicates && childrenUsageIds && typeof index !== 'undefined') {
6464
const updatedKeys = childrenUsageIds.filter((childId, idx) => childId !== containerKey || idx !== index);
6565
await updateContainerChildrenMutation.mutateAsync(updatedKeys);
66+
// istanbul ignore if
6667
if (sidebarItemInfo?.id === containerKey && sidebarItemInfo?.index === index) {
6768
closeLibrarySidebar();
6869
}
6970
} else {
7071
await removeContainerMutation.mutateAsync([containerKey]);
72+
// istanbul ignore if
7173
if (sidebarItemInfo?.id === containerKey) {
7274
closeLibrarySidebar();
7375
}

0 commit comments

Comments
 (0)