import { doManyTests } from '~/tests/integration/helpers'; import { getMakeSut } from '~/tests/integration/helpers/make-sut'; describe('themis.custom.document tests', () => { const makeSut = getMakeSut.customFormat('document', { required: true }); const { sut } = makeSut({}); const testMany = doManyTests(sut); const baseInvalid = [ undefined, null, 'batata', '415e93c7.12b4.408e.854a.ca16d2b92c50', '415e93c7-12b4-408e-854a-ca16d2b92c5', ]; describe('cpf', () => { testMany.valid([ '100.941.790-85', '257.302.470-95', '756.203.760-44', '277.741.340-18', '933.241.250-22', '617.967.280-63', '44417259062', '65147666095', '44082111093', '92422253040', '00781291097', ]); testMany.invalid([ ...baseInvalid, '000.000.000-00', '111.111.111-11', '222.222.222-22', '333.333.333-33', '444.444.444-44', '555.555.555-55', '666.666.666-66', '777.777.777-77', '888.888.888-88', '999.999.999-99', '123.456.789-00', ]); }); // describe('cnpj', () => { // testMany.valid(Array.from({ length: 10 }).map(() => cnpj.generate(true))); // testMany.invalid([ // ...baseInvalid, // '000.000.000-00', // '111.111.111-11', // '222.222.222-22', // '333.333.333-33', // '444.444.444-44', // '555.555.555-55', // '666.666.666-66', // '777.777.777-77', // '888.888.888-88', // '999.999.999-99', // '123.456.789-00', // ]); // }); });