Coder Social home page Coder Social logo

js_is_password_actual's Introduction

Write tests for the isPasswordActual function. This function:

  • takes three numbers: year - year, month - month, date - the date when the password was last updated;
  • converts the received numbers into a date and checks how many days have passed since that date;
  • returns a message about whether to change the password.

If 30 days or less have passed since the last password change, the function returns the message Password is actual..
If more than 30 days have passed since the last password change, the function returns the message You should change your password..
If more than 60 days have passed since the last password change, the function returns the message Immediately change the password!.

Examples (let it be Jun 10, 2021 for today):

isPasswordActual(2020, 6, 9) === `Immediately change the password!`
isPasswordActual(2021, 6, 1) === `Password is actual.`
isPasswordActual(2021, 5, 1) === `You should change your password.`

Guideline

Read more about Jest expectations

js_is_password_actual's People

Contributors

oleksandra-pasenchenko avatar ibrianwarner 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.