{"size": 662, "ext": "js", "max_stars_repo_path": "src/api/manager/getReverseRecord.spec.js", "max_stars_repo_name": "QuarkChain/ens-app", "max_stars_repo_stars_event_min_datetime": "2018-06-13T16:18:05.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-25T19:34:49.000Z", "max_issues_repo_path": "src/api/manager/getReverseRecord.spec.js", "max_issues_repo_name": "QuarkChain/ens-app", "max_issues_repo_issues_event_min_datetime": "2018-07-19T10:47:32.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T15:59:39.000Z", "max_forks_repo_path": "src/api/manager/getReverseRecord.spec.js", "max_forks_repo_name": "QuarkChain/ens-app", "max_forks_repo_forks_event_min_datetime": "2018-06-19T11:34:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T20:29:56.000Z"}
{"max_stars_count": 150, "max_issues_count": 740, "max_forks_count": 168, "avg_line_length": 25.4615384615, "max_line_length": 84, "alphanum_fraction": 0.6208459215}
import getReverseRecord from './getReverseRecord'

jest.mock('../../apollo/mutations/ens', () => ({
  __esModule: true,
  default: jest.fn()
}))

jest.mock('../../apollo/reactiveVars', () => ({
  __esModule: true,
  isENSReadyReactive: jest.fn()
}))
import { emptyAddress } from '../../utils/utils'

describe('getReverseRecord', () => {
  it('should return a default object if ens has not been initied yet', async () => {
    const result = await getReverseRecord(null, { address: '0xaddr1' })
    expect(result).toEqual({
      name: emptyAddress,
      address: '0xaddr1',
      avatar: '',
      match: false,
      __typename: 'ReverseRecord'
    })
  })
})
