Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2b0978b

Browse files
klokoypkozlowski-opensource
authored andcommitted
docs(guide): fix typos in unit test guide
1 parent 1122dc7 commit 2b0978b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/content/guide/dev_guide.unit-testing.ngdoc

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ in the right order. In order to answer such question it is very important that w
1313
That is because when we are testing the sort function we don't want to be forced into crating
1414
related pieces such as the DOM elements, or making any XHR calls in getting the data to sort. While
1515
this may seem obvious it usually is very difficult to be able to call an individual function on a
16-
typical project. The reason is that the developers often time mix concerns, and they end up with a
16+
typical project. The reason is that the developers often mix concerns, and they end up with a
1717
piece of code which does everything. It reads the data from XHR, it sorts it and then it
1818
manipulates the DOM. With angular we try to make it easy for you to do the right thing, and so we
1919
provide dependency injection for your XHR (which you can mock out) and we created abstraction which
@@ -173,7 +173,7 @@ for your application is mixed in with DOM manipulation, it will be hard to test
173173
below:
174174

175175
<pre>
176-
function PasswordController() {
176+
function PasswordCtrl() {
177177
// get references to DOM elements
178178
var msg = $('.ex1 span');
179179
var input = $('.ex1 input');
@@ -207,7 +207,7 @@ $('body').html('<div class="ex1">')
207207
.find('div')
208208
.append(input)
209209
.append(span);
210-
var pc = new PasswordController();
210+
var pc = new PasswordCtrl();
211211
input.val('abc');
212212
pc.grade();
213213
expect(span.text()).toEqual('weak');
@@ -218,7 +218,7 @@ In angular the controllers are strictly separated from the DOM manipulation logi
218218
a much easier testability story as can be seen in this example:
219219

220220
<pre>
221-
function PasswordCntrl($scope) {
221+
function PasswordCtrl($scope) {
222222
$scope.password = '';
223223
$scope.grade = function() {
224224
var size = $scope.password.length;
@@ -236,7 +236,7 @@ function PasswordCntrl($scope) {
236236
and the tests is straight forward
237237

238238
<pre>
239-
var pc = new PasswordController();
239+
var pc = new PasswordCtrl();
240240
pc.password('abc');
241241
pc.grade();
242242
expect(span.strength).toEqual('weak');

0 commit comments

Comments
 (0)