Closed CaffeinatedFunctionality closed 5 years ago
Created the below test as an example `test('12341 obfuscated true results 1234 ', () => { var mask = new CreditCardMask() var expected = '1234 ' var received = mask.getValue('12341', { obfuscated: true })
expect(received).toBe(expected) })`
I was given this in return `Error: expect(received).toBe(expected) // Object.is equality
Expected: "1234 *"
Received: "1234 1"
at Object.toBe (/Users/taylormitchell/Documents/projects/react-native-masked-text/tests/mask/credit-card.mask.test.js:36:20)
at Object.asyncJestTest (/Users/taylormitchell/Documents/projects/react-native-masked-text/node_modules/jest-jasmine2/build/jasmine_async.js:108:37)
at resolve (/Users/taylormitchell/Documents/projects/react-native-masked-text/node_modules/jest-jasmine2/build/queue_runner.js:56:12)
at new Promise (
This tells me something is definitely wrong with the obfuscation for the credit cards. Was this working in the past? If it did then it is now broken.
Obfuscated just let the user to add the first 4 and the last 4.
For some reason Obfuscated: true will skip over the obfuscated numbers. I'm looking in to a fix as well as building an id mask and american phone number mask.