concept invalid phone number in category angular

appears as: n invalid phone number, invalid phone number
Testing Angular Applications

This is an excerpt from Manning's book Testing Angular Applications.

Now let’s see what happens when you try to update a contact with an invalid phone number. Again, notice the bolded code in listing 3.11. The only difference between this test and the previous test is that the number now contains too many digits. Similar to the test before this one, the contact name is the same in both assertions.

Listing 5.2 Test for invalid phone number
it('should not display anything if the length is not 10 digits', 
 () => {    #1  
 const testInputPhoneNumber = '703555012';    #2  
  const transformedPhoneNumber =
    phoneNumber.transform(testInputPhoneNumber);
 const expectedResult = '';    #3  

  expect(transformedPhoneNumber).toBe(expectedResult);
});

#1   Updates the title of the test
#2   Updates test input to an invalid phone number
#3   Updates expected result to an empty string


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":4},{\"line\":0,\"ch\":52}],[{\"line\":0,\"ch\":53},{\"line\":0,\"ch\":55}],[{\"line\":0,\"ch\":56},{\"line\":0,\"ch\":62}],[{\"line\":2,\"ch\":31},{\"line\":2,\"ch\":40}]]"}
!@%STYLE%@!