Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
test login with chai

How can i check test that the email is the same that is logged in, and how can i check it's been saved in localstorage?? please help

code:

const {expect} = require('chai')
const chai = require('chai')
const chaiHttp = require('chai-http')
const user = require('../src/controllers/user-controller')
chai.use(chaiHttp)

describe('API', () => {
describe('Post /Login', () => {
    it('should login', (done)=>{
        const user = {email:"mikkel.wager@gmail.com",password:"password123"}

      chai
      .request("http://localhost:8200/users")
      .post('/login')
      .send(user)
      .end((err,res)=>{
        expect(res.status).to.equal(200);
        expect(err).to.be.null;
        expect(res.body.email).to.be("mikkel.wager@gmail.com")
        done();
        
      })
    })
})
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can use localStorage.getItem("yourVariableValue") to get the data you want. But it would only return the data once you have set it in localStorage using localStorage.setItem("yourVariableValue")

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!