import ModelsUtils from "~/services/utils/modelsUtils";

describe('extractIdFromUri()', () => {
  it('should return null if uri is empty', () => {
    expect(ModelsUtils.extractIdFromUri('')).toBeNull()
  })

  it('should return Error if uri is not an number', () => {
    expect(() => ModelsUtils.extractIdFromUri('/api/person/id')).toThrowError('id is not a number')
  })

  it('should return the id s uri', () => {
    expect(ModelsUtils.extractIdFromUri('/api/person/2')).toEqual(2)
  })
})
