react-activestorage-provider
Version:
A React component that allows easy file upload using ActiveStorage
18 lines (14 loc) • 403 B
Flow
/**
* @noflow
*/
import * as H from './helpers'
describe('compactObject', () => {
it('removes attributes set to undefined', () => {
const object = { a: 1, b: undefined, c: 'c' }
expect(H.compactObject(object)).toEqual({ a: 1, c: 'c' })
})
it('doesn’t remove attributes set to null', () => {
const object = { a: null }
expect(H.compactObject(object)).toEqual(object)
})
})