Giter VIP home page Giter VIP logo

angular-aggrid-testing-techniques's Introduction

Angular Ag-grid Testing Techniques

This is a simple example to demonstrate various techniques to test ag-grid in an Angular app, specifically:

  1. Visualizing different states of a grid-based component using Storybook
  2. Unit testing grid-based components
  3. Integration testing (a.k.a. end-to-end testing) an app that uses the ag-grid

A screen shot of the final app is shown below. It contains a single page with an OrderListComponent that contains orders.

Screen Shot

This project was generated with Angular CLI version 6.0.8.

Quick Start

$ yarn install  <--- npm install works too
$ ng serve

Now point your browser to http://localhost:4200/.

Visual testing

Allows you to visualize different states of your UI components and develop them interactively.

Tools

Tests

  • index.stories.ts: Instantiates the OrderListComponent in two states, empty and filled. This allows you to visually inspect if it is rendered correctly in both states.

Running the tests

yarn storybook

Point your browser to http://localhost:6006/

Unit testing

Tests a single component in isolation.

Tools

Tests

  • order-list.component.spec.ts: Instantiates the OrderListComponent and tests if the columns have the correct titles and the rows have the correct cell values.

Running the tests

ng test

Integration (end-to-end) testing

Tests the app as a black box.

Tools

Tests

  • app.e2e-spec.ts: Navigates to the home page and tests if it renders the order list with the correct headers and order values. Uses a Page Object for low level page operations.

Running the tests

ng e2e

angular-aggrid-testing-techniques's People

Contributors

nareshbhatia avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jenish19 weweaaa

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.