Skip to content

Commit

Permalink
Merge pull request #99 from benhurott/develop
Browse files Browse the repository at this point in the history
1.9.2
  • Loading branch information
Ben-hur Santos Ott authored Oct 7, 2018
2 parents 73c8c71 + b09dc4f commit e65b12e
Show file tree
Hide file tree
Showing 1,300 changed files with 67 additions and 80,015 deletions.
6 changes: 0 additions & 6 deletions .buckconfig

This file was deleted.

53 changes: 0 additions & 53 deletions .flowconfig

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

1 change: 0 additions & 1 deletion .watchmanconfig

This file was deleted.

44 changes: 0 additions & 44 deletions App.js

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Unreleased

## [1.9.2] - 2018-10-06

### Fixed

- [#95](https://github.com/benhurott/react-native-masked-text/issues/95): Number value cause errors into only-numbers mask (thanks to [dfsilva](https://github.com/dfsilva) for reporting)
- [#96](https://github.com/benhurott/react-native-masked-text/issues/96): cel-phone mask is not changing properly. (thanks to [jgfidelis](https://github.com/jgfidelis) for reporting)

## [1.9.1] - 2018-09-09

- Fix [#92](https://github.com/benhurott/react-native-masked-text/issues/92): Unable to resolve module ./masks in v1.9.0 (thanks to [ahce](https://github.com/ahce) for reporting)
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
copy-to-test:
rm -rf ../rn-test/react-native-masked-text
npm run clean
npm run build
cp -R dist ../rn-test/react-native-masked-text
10 changes: 9 additions & 1 deletion __tests__/mask/cel-phone.mask.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,18 @@ test('getMask for 99888877776 returns (99) 99999-9999', () => {
expect(received).toBe(expected)
})

test('getMask for 999998888 withoud DDD returns 99999-9999', () => {
test('getMask for 999998888 without DDD returns 99999-9999', () => {
var mask = new CelPhoneMask()
var expected = '99999-9999'
var received = mask.getMask('999998888', { withDDD: false })

expect(received).toBe(expected)
})

test('getValue for (12) 1234-56789 must return (12) 12345-6789', () => {
var mask = new CelPhoneMask()
var expected = '(12) 12345-6789'
var received = mask.getValue('(12) 1234-56789')

expect(received).toBe(expected)
})
64 changes: 36 additions & 28 deletions __tests__/mask/only-numbers.mask.test.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
import { OnlyNumbersMask } from '../../lib/masks';
import { OnlyNumbersMask } from '../../lib/masks'

test('getType results only-numbers', () => {
var expected = 'only-numbers';
var received = OnlyNumbersMask.getType();
var expected = 'only-numbers'
var received = OnlyNumbersMask.getType()

expect(received).toBe(expected);
});
expect(received).toBe(expected)
})

test('abc123 results 123', () => {
var mask = new OnlyNumbersMask();
var expected = '123';
var received = mask.getValue('abc123');
var mask = new OnlyNumbersMask()
var expected = '123'
var received = mask.getValue('abc123')

expect(received).toBe(expected);
});
expect(received).toBe(expected)
})

test('1 results 1', () => {
var mask = new OnlyNumbersMask();
var expected = '1';
var received = mask.getValue('1');
var mask = new OnlyNumbersMask()
var expected = '1'
var received = mask.getValue('1')

expect(received).toBe(expected);
});
expect(received).toBe(expected)
})

test('abc results ', () => {
var mask = new OnlyNumbersMask();
var expected = '';
var received = mask.getValue('abc');
var mask = new OnlyNumbersMask()
var expected = ''
var received = mask.getValue('abc')

expect(received).toBe(expected);
});
expect(received).toBe(expected)
})

test('1 results 1 and raw value 1', () => {
var mask = new OnlyNumbersMask();
var expected = '1';
var received = mask.getValue('1');
var mask = new OnlyNumbersMask()
var expected = '1'
var received = mask.getValue('1')

var expectedRawValue = '1';
var receivedRawValue = mask.getRawValue(received);
var expectedRawValue = '1'
var receivedRawValue = mask.getRawValue(received)

expect(received).toBe(expected);
expect(receivedRawValue).toBe(expectedRawValue);
});
expect(received).toBe(expected)
expect(receivedRawValue).toBe(expectedRawValue)
})

test('number value return correct masked value', () => {
var mask = new OnlyNumbersMask()
var expected = '1'
var received = mask.getValue(1)

expect(received).toBe(expected)
})
1 change: 0 additions & 1 deletion android/.gradle/2.14.1/taskArtifacts/cache.properties

This file was deleted.

Binary file not shown.
Binary file removed android/.gradle/2.14.1/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 0 additions & 19 deletions android/RnTest.iml

This file was deleted.

65 changes: 0 additions & 65 deletions android/app/BUCK

This file was deleted.

Loading

0 comments on commit e65b12e

Please sign in to comment.