coverage: ignore useI18n

This commit is contained in:
David Lechner
2022-03-25 15:54:04 -05:00
parent 5dd61fa4c3
commit f36e774d1e
19 changed files with 28 additions and 7 deletions
+1
View File
@@ -29,6 +29,7 @@ const AboutDialog: React.VoidFunctionComponent<AboutDialogProps> = ({
}) => {
const [isLicenseDialogOpen, setIsLicenseDialogOpen] = useState(false);
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
+1
View File
@@ -141,6 +141,7 @@ const Editor: React.VoidFunctionComponent<EditorProps> = ({ onEditorChanged }) =
const [editor, setEditor] = useState<EditorType>(null);
const { isDarkMode } = useTernaryDarkMode();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
+1
View File
@@ -371,6 +371,7 @@ const FileTree: React.VoidFunctionComponent<FileTreeProps> = ({ i18n }) => {
};
const Explorer: React.VFC = () => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
@@ -78,6 +78,7 @@ const FileNameFormGroup: React.VoidFunctionComponent<FileNameFormGroupProps> = (
inputRef,
onChange,
}) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const fileNameIntent =
@@ -36,6 +36,7 @@ const NewFileWizard: React.VoidFunctionComponent<NewFileWizardProps> = ({
isOpen,
onClose,
}) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
@@ -15,10 +15,11 @@ import { renameFileDialogDidAccept, renameFileDialogDidCancel } from './actions'
import { I18nId } from './i18n';
const RenameFileDialog: React.VFC = () => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
const isOpen = useSelector((s) => s.explorer.renameFileDialog.isOpen);
const oldName = useSelector((s) => s.explorer.renameFileDialog.fileName);
const [i18n] = useI18n();
const [baseName, extension] = oldName.split(/(\.\w+)$/);
+1
View File
@@ -183,6 +183,7 @@ const LicenseDialog: React.VoidFunctionComponent<LicenseDialogProps> = ({
const [licenseInfo, setLicenseInfo] = useState<LicenseInfo | undefined>(undefined);
const infoDiv = React.useRef<HTMLDivElement>(null);
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
+1
View File
@@ -16,6 +16,7 @@ const NotificationAction: React.VoidFunctionComponent<NotificationActionProps> =
messageId,
replacements,
}) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return <>{i18n.translate(messageId, replacements)}</>;
@@ -16,6 +16,7 @@ const NotificationMessage: React.VoidFunctionComponent<NotificationMessageProps>
messageId,
replacements,
}) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
let message = i18n.translate(messageId, replacements) as
@@ -16,6 +16,7 @@ type UnexpectedErrorNotificationProps = {
const UnexpectedErrorNotification: React.VoidFunctionComponent<
UnexpectedErrorNotificationProps
> = ({ messageId, err }) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
+1
View File
@@ -76,6 +76,7 @@ const SettingsDrawer: React.VoidFunctionComponent<SettingsProps> = ({
const dispatch = useDispatch();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const hotkeys = useMemo(
+3 -1
View File
@@ -107,9 +107,11 @@ const BatteryIndicator: React.VoidFunctionComponent<BatteryIndicatorProps> = ({
};
const StatusBar: React.VFC = (_props) => {
const connection = useSelector((s) => s.ble.connection);
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const connection = useSelector((s) => s.ble.connection);
return (
<div
className="pb-status-bar"
+1
View File
@@ -54,6 +54,7 @@ function createContextMenu(
xterm: XTerm,
): (props: ContextMenu2ContentProps) => JSX.Element {
const contextMenu = (_props: ContextMenu2ContentProps): JSX.Element => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
@@ -21,8 +21,9 @@ const BluetoothButton: React.VFC = () => {
bootloaderConnection === BootloaderConnectionState.Disconnected &&
bleConnection === BleConnectionState.Disconnected;
const dispatch = useDispatch();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
return (
<ActionButton
+2 -1
View File
@@ -25,8 +25,9 @@ const FlashButton: React.VFC = () => {
const [isSettingFlashCurrentProgramEnabled] = useSettingFlashCurrentProgram();
const { hubName } = useSettingHubName();
const dispatch = useDispatch();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
return (
<OpenFileButton
+3 -1
View File
@@ -12,9 +12,11 @@ import { I18nId } from './i18n';
import icon from './icon.svg';
const ReplButton: React.VFC = () => {
const enabled = useSelector((s) => s.hub.runtime === HubRuntimeState.Idle);
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
const enabled = useSelector((s) => s.hub.runtime === HubRuntimeState.Idle);
const action = useCallback(() => dispatch(repl()), [dispatch]);
return (
+2 -1
View File
@@ -20,8 +20,9 @@ const RunButton: React.VFC = () => {
const hasEditor = useSelector((s) => s.app.hasEditor);
const keyboardShortcut = 'F5';
const dispatch = useDispatch();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
return (
<ActionButton
@@ -12,6 +12,7 @@ type SettingsButtonProps = Pick<ActionButtonProps, 'onAction'>;
const SettingsButton: React.VoidFunctionComponent<SettingsButtonProps> = ({
onAction,
}) => {
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
return (
+2 -1
View File
@@ -15,8 +15,9 @@ const StopButton: React.VFC = () => {
const runtime = useSelector((s) => s.hub.runtime);
const keyboardShortcut = 'F6';
const dispatch = useDispatch();
// istanbul ignore next: babel-loader rewrites this line
const [i18n] = useI18n();
const dispatch = useDispatch();
return (
<ActionButton