mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
coverage: ignore useI18n
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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+)$/);
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user