Skip to content

quangpdt/angular-simple-test

Repository files navigation

Customer List

Environment

  • Angular CLI Version: 10.0.4
  • Angular Core Version: 10.0.4
  • Node Version: 14(LTS)
  • Default Port: 8000

Application Demo:

Functionality Requirements

The component must have the following functionalities:

  • The input should initially be empty.

  • If no value is entered, clicking on the Add Customer button should not do anything.

  • If a value is present, clicking on the Add Customer button should add the input value to the list below. For this, add <li>{input}</li> to the <ul data-test-id="customer-list"> element.

  • After adding the value to the list, clear the value of the input box.

  • Please note that the customer list <ul> element should only be rendered if it has at least one customer added (i.e., at least one <li> child). So initially, when the app is mounted, the <ul> element should not be rendered since no customers have been added.

  • All the values added by the button should be rendered in the list below.

Testing Requirements

  • The input should have the data-test-id attribute app-input.
  • The button should have the data-test-id attribute submit-button.
  • The customer list <ul> should have the data-test-id attribute customer-list.
  • Elements in the list should have the data-test-id attribute as list-item0, list-item1, list-item2, list-item3, and so on.

Project Specifications

Read Only Files

  • src/app/app.component.spec.ts
  • src/app/customer-list/customer-list.component.spec.ts

Commands

  • run:
npm start
  • install:
npm install
  • test:
npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published