From 4100fb428e6e05c3548230951b32e53f7e2d5fea Mon Sep 17 00:00:00 2001 From: VLE2FE Date: Fri, 15 May 2020 14:56:42 +0200 Subject: [PATCH] material numbers defined as string, colors without numbers and numbers with leading zeros can be added --- src/routes/material.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/routes/material.spec.ts b/src/routes/material.spec.ts index 746a620..8b212aa 100644 --- a/src/routes/material.spec.ts +++ b/src/routes/material.spec.ts @@ -3,7 +3,6 @@ import _ from 'lodash'; import MaterialModel from '../models/material'; import TestHelper from "../test/helper"; -// TODO: deal with numbers with leading zeros describe('/material', () => { let server; @@ -378,7 +377,7 @@ describe('/material', () => { url: '/material/new', auth: {basic: 'janedoe'}, httpStatus: 200, - req: {name: 'Crastin CE 2510', supplier: 'Du Pont', group: 'PBT', mineral: 0, glass_fiber: 30, carbon_fiber: 0, numbers: [{color: 'black', number: '5515798402'}]} + req: {name: 'Crastin CE 2510', supplier: 'Du Pont', group: 'PBT', mineral: 0, glass_fiber: 30, carbon_fiber: 0, numbers: [{color: 'black', number: '05515798402'}]} }).end((err, res) => { if (err) return done (err); should(res.body).have.only.keys('_id', 'name', 'supplier', 'group', 'mineral', 'glass_fiber', 'carbon_fiber', 'numbers'); @@ -392,7 +391,7 @@ describe('/material', () => { should(res.body.numbers).matchEach(number => { should(number).have.only.keys('color', 'number'); should(number).have.property('color', 'black'); - should(number).have.property('number', '5515798402'); + should(number).have.property('number', '05515798402'); }); done(); });