Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kamil Kisiela
authored and
Dotan Simha
committed
Nov 22, 2016
1 parent
3787cab
commit 9e11c5d
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
imports/ui/components/partyRemove/client/partyRemove.tests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { name as PartyRemove } from '../partyRemove'; | ||
import { Parties } from '../../../../api/parties'; | ||
import 'angular-mocks'; | ||
|
||
describe('PartyRemove', () => { | ||
beforeEach(() => { | ||
window.module(PartyRemove); | ||
}); | ||
|
||
describe('controller', () => { | ||
let controller; | ||
const party = { | ||
_id: 'partyId' | ||
}; | ||
|
||
beforeEach(() => { | ||
inject(($rootScope, $componentController) => { | ||
controller = $componentController(PartyRemove, { | ||
$scope: $rootScope.$new(true) | ||
}, { | ||
party | ||
}); | ||
}); | ||
}); | ||
|
||
describe('remove()', () => { | ||
beforeEach(() => { | ||
spyOn(Parties, 'remove'); | ||
controller.remove(); | ||
}); | ||
|
||
it('should remove a party', () => { | ||
expect(Parties.remove).toHaveBeenCalledWith(party._id); | ||
}); | ||
}); | ||
}); | ||
}); |