New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

add-test-ids

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

add-test-ids

Add test ids to your react components

latest
npmnpm
Version
1.0.5
Version published
Weekly downloads
17
466.67%
Maintainers
1
Weekly downloads
 
Created
Source

add-test-ids

add-test-ids is a command-line tool that adds unique test IDs to your React components on one click. It's designed to work with MUI components.

Installation

You can install add-test-ids globally with npm:

npm  install  -g  add-test-ids

After installing you run simply the following command in you project root directory.

npx add-test-ids

This will ask you for two questions:

Please enter a directory path: src

Please enter file extensions, separated by commas: .tsx, .jsx

Example result

    import React from 'react';

    const ExampleComponent = () => {
      return (
        <Box data-testId="ypq-12h">Example Component</Box>
      )
    }
    
    export default Component;

This package will add data-testId in the following MUI components:

 const  muiElements  = [

'AppBar',

'Avatar',

'Backdrop',

'Badge',

'BottomNavigation',

'BottomNavigationAction',

'Box',

'Button',

'ButtonBase',

'ButtonGroup',

'Card',

'CardActionArea',

'CardActions',

'CardContent',

'CardHeader',

'CardMedia',

'Checkbox',

'Chip',

'CircularProgress',

'ClickAwayListener',

'Collapse',

'Container',

'CssBaseline',

'Dialog',

'DialogActions',

'DialogContent',

'DialogContentText',

'DialogTitle',

'Divider',

'Drawer',

'ExpansionPanel',

'ExpansionPanelActions',

'ExpansionPanelDetails',

'ExpansionPanelSummary',

'Fab',

'Fade',

'FilledInput',

'FormControl',

'FormControlLabel',

'FormGroup',

'FormHelperText',

'FormLabel',

'Grid',

'GridList',

'GridListTile',

'GridListTileBar',

'Hidden',

'Icon',

'IconButton',

'Input',

'InputLabel',

'LinearProgress',

'Link',

'List',

'ListItem',

'ListItemAvatar',

'ListItemIcon',

'ListItemSecondaryAction',

'ListItemText',

'ListSubheader',

'Menu',

'MenuItem',

'MenuList',

'MobileStepper',

'Modal',

'NativeSelect',

'OutlinedInput',

'Pagination',

'PaginationItem',

'Paper',

'Popover',

'Popper',

'Portal',

'Radio',

'RadioGroup',

'RootRef',

'Select',

'Slide',

'Slider',

'Snackbar',

'SnackbarContent',

'Step',

'StepButton',

'StepConnector',

'StepContent',

'StepIcon',

'StepLabel',

'Stepper',

'SvgIcon',

'SwipeableDrawer',

'Switch',

'Tab',

'Table',

'TableBody',

'TableCell',

'TableContainer',

'TableFooter',

'TableHead',

'TablePagination',

'TableRow',

'TableSortLabel',

'Tabs',

'TextField',

'TextareaAutosize',

'Toolbar',

'Tooltip',

'Typography',

];

Contributions are welcomed, you can contribute in this github repo: Repo Link

Keywords

test-ids

FAQs

Package last updated on 04 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts