Implemented logic to edit domain redirects

This commit is contained in:
Alejandro Celaya
2021-08-21 17:53:06 +02:00
parent bf29158a8a
commit 69cb3bd619
28 changed files with 347 additions and 141 deletions

View File

@@ -1,4 +1,4 @@
import { determineOrderDir, rangeOf } from '../../src/utils/utils';
import { determineOrderDir, nonEmptyValueOrNull, rangeOf } from '../../src/utils/utils';
describe('utils', () => {
describe('determineOrderDir', () => {
@@ -47,4 +47,17 @@ describe('utils', () => {
]);
});
});
describe('nonEmptyValueOrNull', () => {
it.each([
[ '', null ],
[ 'Hello', 'Hello' ],
[[], null ],
[[ 1, 2, 3 ], [ 1, 2, 3 ]],
[{}, null ],
[{ foo: 'bar' }, { foo: 'bar' }],
])('returns expected value based on input', (value, expected) => {
expect(nonEmptyValueOrNull(value)).toEqual(expected);
});
});
});