Feedreader Jasmine Test
Test-driven development
Brief Description
As part of my Udacity Front-end Nanodegree Program, I was given a web-based application that reads RSS feeds from various sources. I am required to use Jasmine to write a number of unit tests to test the underlying logic of the application as well as the event handling and DOM manipulation.Technology Used
- Jasmine testing framework
- JavaScript
The Process Taken
I wrote the following 7 test specs:
- Test to ensure that the RSS source array variable is defined and not empty
- Loop through each feed object and test to ensure that each feed object has a URL defined and is not empty
- Loop through each feed and test to ensure that each feed object has a name defined and not empty
- Ensure the menu element is hidden by default
- Ensure that menu is visible when the menu icon is selected
- Test for at least a single feed showing when the loadFeed function's AJAX call returns the feed data
- Test to ensure the feed display changes content when a different feed source has been selected