- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
| <h1>REGISTRO DE USUARIO</h1> | |
| <form method="post" id="registro"> | |
| <label for="usuarioRegistro"></label> | |
| <input type="text" placeholder="Usuario" maxlength="6" id="usuarioRegistro" name="usuario" required> | |
| <label for="passwordRegistro"></label> | |
| <input type="password" placeholder="Contraseña" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}" id="passwordRegistro" name="password" required> |
| let formRegistro = document.querySelector('#registro'); | |
| var user = document.querySelector('#usuarioRegistro').value; | |
| let validarUser = () => { | |
| let expression = /^[a-zA-Z0-9]$/; | |
| if(user == "") { | |
| document.querySelector('label[for="usuarioRegistro"]') | |
| .innerHTML = '<p>Elemento vacio</p>'; | |
| <?php require 'header.php'; ?> | |
| <h1>Productos</h1> | |
| <section class="btn-content"> | |
| <a href="<?php echo RUTATOTAL;?>descartable"><div class="btn-icon"></div>Descartables</a> | |
| <a href="<?php echo RUTATOTAL;?>ampolla"><div class="btn-icon"></div>Ampollas</a> | |
| <a href="<?php echo RUTATOTAL;?>medicina"><div class="btn-icon"></div>Medicamentos</a> | |
| <a href="<?php echo RUTATOTAL;?>quirurgico"><div class="btn-icon"></div>Equipo Quirúrgico</a> |
| <?php | |
| try { | |
| $conexion = new PDO("mysql:host=localhost;dbname=laferia", "root", ""); | |
| }catch(PDOException $e) { | |
| echo "ERROR" , $e->getMessage(); | |
| die(); | |
| } |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Untitled</title> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> |
| <?php | |
| try { | |
| $conexion = new PDO("mysql:host=localhost;dbname=laferia", "root", ""); | |
| }catch(PDOException $e) { | |
| echo "ERROR" , $e->getMessage(); | |
| die(); | |
| } |