In this project I was given a web-based application that reads RSS feeds. The original developer of this application clearly saw the value in testing, they've already included Jasmine and even started writing their first test suite! Unfortunately, they decided to move on to start their own company and we're now left with an application with an incomplete test suite. I've been asked to help.
I learned how to use Jasmine to write a number of tests against a pre-existing application. These will test the underlying business logic of the application as well as the event handling and DOM manipulation.
Reviewed the Feed Reader Testing Project Rubric
- Took the JavaScript Testing course
- Downloaded the required project assets.
- Reviewed the functionality of the application within my browser.
- Explored the application's HTML (./index.html), CSS (./css/style.css) and JavaScript (./js/app.js) to gain an understanding of how it works.
- Explored the Jasmine spec file in ./jasmine/spec/feedreader.js and review the Jasmine documentation.
- Edited the
allFeeds
variable in ./js/app.js to make the provided test fail and see how Jasmine visualizes this failure in your application. - Return the
allFeeds
variable to a passing state. - Wrote a test that loops through each feed in the
allFeeds
object and ensures its URL defined and that the URL is not empty. - Wrote a test that loops through each feed in the
allFeeds
object and ensures its name is defined and that the name is not empty. - Wrote a new test suite named
"The menu"
. - Wrote a test that ensures the menu element is hidden by default. Analyzed the HTML and the CSS to determine how its performing the hiding/showing of the menu element.
- Wrote a test that ensures the menu changes visibility when the menu icon is clicked. This test had two expectations: does the menu display when clicked and does it hide when clicked again.
- Wrote a test suite named
"Initial Entries"
. - Wrote a test that ensured when the
loadFeed
function is called and completed its work, there is at least a single.entry
element within the.feed
container. - Wrote a test suite named
"New Feed Selection"
. - Wrote a test that ensured when a new feed is loaded by the
loadFeed
function that the content actually changed. - No test was be dependent on the results of another.
- Callbacks are used to ensure that feeds are loaded before they are tested.
- Implemented error handling for undefined variables and out-of-bound array access.
- All of my tests should pass.
-
Slack cohort help various students
-
M. Kroth Facebook Group
Go to Github and download or clone just navigate to https://github.com/tcjill/FRJILL.git Download the files to your computer and open them. You will be able to see all related files. Open index.html in your browser to see the Jasmine testing in action.