Skip to content

Instantly share code, notes, and snippets.

View alce65's full-sized avatar

Alejandro Cerezo alce65

View GitHub Profile
@alce65
alce65 / getDataFromForm.test.ts
Last active October 31, 2025 08:52
Funtions to extract data from a HTML form element or a formData
describe('FormTools', () => {
const formElement = document.createElement('form');
formElement.innerHTML = `
<input type="text" name="username" value="test user"/>
<input type="password" name="password" value="test pass" />
`;
const mockInitialData = {
username: '',
password: '',
@alce65
alce65 / test,js
Created September 2, 2022 14:16
Pregunta de un alumno
const adminAction = () => {
const action = askForAdminAction ();
if (action === "create"){
for(i = 0; i<= 15; i++) {
showFlights();
const newFlight = {};
newFlight.to = prompt("To:");
newFlight.from = prompt("From:");
newFlight.cost = +prompt("Cost:");
newFlight.scale = +prompt("Scale (true/false):");