
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@calm/testing-library-selector-18
Advanced tools
Reusable selectors for @testing-library. Define selectors for ui elements that can be reused inside the same test or between tests. Full typescript support.
npm install --save-dev testing-library-selector
yarn add -D testing-library-selector
import { byLabelText, byRole, byTestId } from './selector';
// define reusable selectors
const ui = {
container: byTestId('my-container'),
submitButton: byRole('button', { name: 'Submit' }),
usernameInput: byLabelText('Username:'),
// can encode more specific html element type
passwordInput: byLabelText<HTMLInputElement>('Password:'),
};
// reuse them in the same test or across multiple tests by calling
// .get(), .getAll(), .find(), .findAll(), .query(), .queryAll()
it('example test', async () => {
// by default elements will be queried against screen
await ui.submitButton.find();
expect(ui.submitButton.query()).not.toBeInDocument();
expect(ui.submitButton.get()).toBeInDocument();
const containers = ui.container.getAll();
expect(containers).toHaveLength(3);
// provide a container as first param to query element inside that container
const username = ui.usernameInput.get(containers[0]);
});
FAQs
selectors for react testing library
We found that @calm/testing-library-selector-18 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 96 open source maintainers collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.