valiamaximova1

03. Dealership test js

Feb 19th, 2021 (edited)
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('test',  () => {
  2.     describe('newCarCost', () => {
  3.         it('returns original price when model unsupported',  () => {
  4.             expect(dealership.newCarCost('a', 1)).to.equal(1);
  5.         })
  6.         it('returns discounted price',  () => {
  7.             expect(dealership.newCarCost('Audi A4 B8', 30000)).to.equal(15000);
  8.         })
  9.  
  10.     })
  11.  
  12.     describe('carEquipment', () => {
  13.         it('single element',  () => {
  14.             expect(dealership.carEquipment(['a'], [0])).to.deep.equal(['a']);
  15.         })
  16.         it('single element',  () => {
  17.             expect(dealership.carEquipment(['a', 'b', 'c'], [0, 2])).to.deep.equal(['a', 'c']);
  18.         })
  19.         it('single element',  () => {
  20.             expect(dealership.carEquipment(['a', 'b', 'c'], [1])).to.deep.equal(['b']);
  21.         })
  22.     })
  23.  
  24.     describe('euroCategory', () => {
  25.         it('gfg', function (){
  26. expect(dealership.euroCategory(1)).to.equal('Your euro category is low, so there is no discount from the final price!')
  27.         })
  28.         it('gfg1', function (){
  29.             expect(dealership.euroCategory(5)).to.equal('We have added 5% discount to the final price: 14250.')
  30.         })
  31.         it('gfg12', function (){
  32.             expect(dealership.euroCategory(4)).to.equal('We have added 5% discount to the final price: 14250.')
  33.         })
  34.     })
  35.  
  36.  
  37. })
Add Comment
Please, Sign In to add comment