Coder Social home page Coder Social logo

refactoring-srv-fe's Introduction

๐Ÿงฎ Counter Component

The Counter component is a simple React component that allows you to display a count value and perform basic count manipulation operations.

โœ… Prerequisite

Before using the Counter component, make sure you have the following prerequisites installed:

  • Node.js: >= 16.0.0
  • npm: >= 7.0.0

๐Ÿ—๏ธ Installation

  1. Clone the repository.
  2. Install dependencies by running the following command:
    npm install
    

๐Ÿ‘จโ€๐Ÿ’ป Usage

Development Server Setup

To start the development server, run the following command:

npm run dev

The application will be accessible at http://localhost:3000.

Production Server Setup

To start the Production server, run the following command:

npm run build

then run

npm start

This script starts the built production version of your Next.js application. When you run npm start, Next.js starts a server to serve the previously built production assets. This script is typically used in a production environment to serve your application to users.

The application will be accessible at http://localhost:3000.

๐Ÿšฉ Props

The Counter component does not accept any props.

๐Ÿงช Testing

To test the functionality of the Counter component use the following command

npm run cypress

โ„น๏ธ Test Instructions

All test instructions are inside the app.cy.js file as comments. Here you can see the main E2E test cases instructions

describe("Counter", () => {
  beforeEach(() => {
    cy.visit("http://localhost:3000");
  });

  it("should increase the count by 10 and display toast message", () => {
    // Test code here...
  });

  it("should reset the count to 0", () => {
    // Test code here...
  });

  it("should decrease the count by 10 and display toast message", () => {
    // Test code here...
  });
});

๐ŸŽฌ Demos

Application Behaviour

Application.Behaviour.mp4

Testing Behaviour

Testing.Behaviour.mp4

refactoring-srv-fe's People

Contributors

p4nduxcv avatar

Watchers

 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.