TAILIEUCHUNG - Phát triển Javascript - part 44

Tham khảo tài liệu 'phát triển javascript - part 44', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | The User Form 403 Still no luck. To make matters worse adding that line actually failed the previous test as well because it didn t set a view. We can fix that by checking that the view is set before asking it for elements as Listing does. Listing Checking that is available function handleSubmit event if var input input 0 That gets the previous test back to green but the current test still fails. It turns out that setview doesn t actually well set the view. Listing fixes setview. Listing Storing a reference to the view function setView element . element And with that all tests pass. We can now tend to the test case which currently duplicates some effort. Both of the tests create a stubbed event object which can and should be elevated to setup. Listing shows the updated setup. Listing Stubbing event in setup function userFormControllerSetUp . preventDefault stubFn Notifying Observers of the User Once the user has been set the controller should notify any observers. Listing tests this by observing the event handling the event and asserting that the observer was called. Download from 404 TDD and DOM Manipulation The Chat Client Listing Expecting handleSubmit to notify observers test should notify observers of username function var input input 0 Bullrog var observer stubFn user observer assert assertEquals Bullrog 0 That test should trigger all kinds of duplication alarms. Don t worry we ll get on fixing it shortly. As expected the test fails because the controller has no observe method. To fix this we can extend the controller with . observable. For this to

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.