Giter Club home page Giter Club logo

feed-reader's Introduction

Frontend Nanodegree Project


Feed Reader Project

For this project we were provided with a web based application that reads RSS feeds. We then needed to implement testing of the app using the Jasmine testing framework. The original developer had set up their initial test suite and we needed to complete this task by completing the tests listed in overview below.

This is a project from Udacity's Frontend Nanodegree program.


Visit: feed reader

feed reader project


Overview

The required tests:

  • Write a test that loops through each feed in the allFeeds object and ensures it has a URL defined and that the URL is not empty.
  • Write a test that loops through each feed in the allFeeds object and ensures it has a name defined and that the name is not empty.
  • Write a new test suite named "The menu".
  • Write a test that ensures the menu element is hidden by default.
  • Write a test that ensures the menu changes visibility when the menu icon is clicked. This test should have two expectations: does the menu display when clicked and does it hide when clicked again.
  • Write a test suite named "Initial Entries".
  • Write a test that ensures when the loadFeed function is called and completes its work, there is at least a single .entry element within the .feed container.
  • Write a test suite named "New Feed Selection".
  • Write a test that ensures when a new feed is loaded by the loadFeed function that the content actually changes.

Installation

To run the project please fork a copy to your Git Hub account and clone to your local machine with Git.

  • Open index.html in the browser to view.
  • The test suites and individual test results are listed at the bottom of page, or the failed tests are detailed.
  • The actual tests are located in jasmine/spec/feedreader.js.

Future Feature Tests

I've added tests for a feature that is not yet implemented in the application. This feature shows a 'tick' icon when the user selects a listed feed article. The ticks let them know which feed articles they have already viewed.

The icon could possibly be added to the page by appending a conditional <span class="icon icon-checkmark"></span> to the handlebars template on click.


Extra tests summary:

  • Test that the check-mark icon is not visible by default when the feed first loads.
  • Test that when a feed article is selected the check-mark icon is visible.

The future feature test suite:

    describe('Visited Icon', function() {

        beforeEach(function(done) { // pass done to the callback

            loadFeed(1, done); // call loadFeed function - load a different feed
        });

        /* Test to check there is no visited icon (check-mark tick) visible by default when the feed first loads*/
        xit('does not show by default', function() { // marked 'xit' as a pending test

            var checkIcon = $('article').hasClass('icon-checkmark'); // try to find a .icon-checkmark, which is a tick
            expect(checkIcon).not.toEqual(true); // expect on first loading a feed not to find it
        });

        /* Test to check visited icon shows when feed article is clicked and visited*/
        xit('shows after feed article has been visited', function() { // marked 'xit' as a pending test

            var selected = $('.entry-link').first(); // the first list item from the feed-list
            selected.click(); // select - 'click' the first item. This should show the check icon
            var showCheckIcon = $('article').hasClass('icon-checkmark'); // try to find a .icon-checkmark
            expect(showCheckIcon).toEqual(true); // expect this to be true - the check icon is visible showing the feed article has been visited by the user.
        });
    });
  • Both tests are marked as pending with 'xit'.
  • If run, the first test will currently pass because the checkmark icon is already not defined.
  • If run, the last test will fail because the feature is not yet implemented.

feed-reader's People

Contributors

dar77 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.