describe('Test: UserList.service', ()=> {

  beforeEach(module('app'))

  describe('User list service', () => {
    let usersListService, $http, $httpBackend
    let responseData = [
      {
        "id": 1,
        "name": "Leanne Graham",
        "username": "Bret",
        "email": "Sincere@april.biz"
      },
      {
        "id": 2,
        "name": "Ervin Howell",
        "username": "Antonette",
        "email": "Shanna@melissa.tv"
      }
    ]

    beforeEach(inject(( _$http_, _$httpBackend_, _usersListService_) => {
      $http = _$http_
      $httpBackend = _$httpBackend_

      $httpBackend
        .when('GET', 'https://jsonplaceholder.typicode.com/users')
        .respond(responseData)

      usersListService = _usersListService_

      $httpBackend.flush()
    }))

    afterEach(() => {
      $httpBackend.verifyNoOutstandingExpectation();
      $httpBackend.verifyNoOutstandingRequest();
    })

    it('Service must be defined', () => {
      expect(usersListService).toBeDefined
    })

    it('Method: getUsers - Successful get user data and save it', () => {
      $httpBackend.expectGET('https://jsonplaceholder.typicode.com/users')
      usersListService.getUsers($http)
      $httpBackend.flush();
      expect(usersListService.users.length).toBe(2)
    })

    it('Method: deleteUser - Remove user from array', () => {
      usersListService.deleteUser(1)
      expect(usersListService.users.length).toEqual(1)
      usersListService.deleteUser(2)
      expect(usersListService.users.length).toEqual(0)
    })

    it('Method: getId - should create new unique ID for new user', () => {
      const ID = usersListService.getId()
      usersListService.users.forEach( x => {
        expect(x.id).not.toEqual(ID)
      })
    })

    it('Method: addUser - should add new user object to array', () => {
      const newUser = {
        name: 'Ivanov Peter',
        username: 'havok123',
        email: 'havok123@mail.mail'
      }

      usersListService.addUser(newUser)
      expect(usersListService.users.length).toEqual(3)
      expect(usersListService.users[2].id).toEqual(3)
      expect(usersListService.users[2].name).toEqual(newUser.name)
      expect(usersListService.users[2].username).toEqual(newUser.username)
    })

  })

})

@@ -34,14 +34,14 @@
 , ()
+ 
 =%3E %7B%0A
-%0A
   be
@@ -192,20 +192,20 @@
         
-%22id%22
+'id'
 : 1,%0A   
@@ -209,25 +209,25 @@
         
-%22
+'
 name
-%22: %22
+': '
 Leanne G
@@ -231,17 +231,17 @@
 e Graham
-%22
+'
 ,%0A      
@@ -238,33 +238,33 @@
 m',%0A        
-%22
+'
 username
 %22: %22Bret%22,%0A 
@@ -255,17 +255,17 @@
 name
-%22: %22
+': '
 Bret
-%22
+'
 ,%0A  
@@ -270,26 +270,26 @@
         
-%22
+'
 email
-%22: %22
+': '
 Sincere@
@@ -297,17 +297,17 @@
 pril.biz
-%22
+'
 %0A      %7D
@@ -328,12 +328,12 @@
     
-%22id%22
+'id'
 : 2,
@@ -345,17 +345,17 @@
     
-%22
+'
 name
-%22: %22
+': '
 Ervi
@@ -362,17 +362,17 @@
 n Howell
-%22
+'
 ,%0A      
@@ -377,17 +377,17 @@
     
-%22
+'
 username
 %22: %22
@@ -382,20 +382,20 @@
 username
-%22: %22
+': '
 Antonett
@@ -395,17 +395,17 @@
 ntonette
-%22
+'
 ,%0A      
@@ -410,18 +410,18 @@
     
-%22
+'
 email
-%22: %22
+': '
 Shan
@@ -437,9 +437,9 @@
 a.tv
-%22
+'
 %0A   
@@ -450,16 +450,136 @@
 %0A    %5D%0A%0A
+    const wrongUser = %7B%0A        name: 'Ivan Smith',%0A        username: 'bret',%0A        email: 'smith@mail.mail'%0A      %7D%0A%0A
     befo
@@ -593,17 +593,16 @@
 inject((
- 
 _$http_,
@@ -974,17 +974,16 @@
 tation()
-;
 %0A      $
@@ -1022,17 +1022,16 @@
 equest()
-;
 %0A    %7D)%0A
@@ -1342,9 +1342,8 @@
 sh()
-;
 %0A   
@@ -1807,17 +1807,16 @@
 forEach(
- 
 x =%3E %7B%0A 
@@ -2368,16 +2368,360 @@
     %7D)%0A%0A
+    it('Method: uniqueValue - should return false on non-unique username', () =%3E %7B%0A      expect(usersListService.uniqueValue('username', wrongUser.username)).toBe(false)%0A    %7D)%0A%0A    it('Method: uniqueValue - should return true on unique email', () =%3E %7B%0A      expect(usersListService.uniqueValue('username', wrongUser.email)).toBe(true)%0A    %7D)%0A%0A
   %7D)%0A%0A%7D)

add two tests for uniqueValue method