diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-08-08 15:07:10 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-08-08 13:23:11 +0000 |
commit | 8dfd16decdc478a2674c9f2ffa18b67c3cb7963e (patch) | |
tree | 6d4b3299bd0fb6228d2ea4877dfc538bf4d785ff /src/app/shared | |
parent | b445be8e838c20ec6f00121a86abb62a3a2e2554 (diff) |
order-by.pipe : added test case
wrote test case to test order-by-pipe to return proper value when
orderby parameter is not set.
Issue-ID: APPC-1064
Change-Id: I4496e9a3371b540ce0da63ef254a4d9bc4214710
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'src/app/shared')
-rw-r--r-- | src/app/shared/modules/tidy-table/order-by.pipe.spec.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app/shared/modules/tidy-table/order-by.pipe.spec.ts b/src/app/shared/modules/tidy-table/order-by.pipe.spec.ts index 5746fe9..c856ebd 100644 --- a/src/app/shared/modules/tidy-table/order-by.pipe.spec.ts +++ b/src/app/shared/modules/tidy-table/order-by.pipe.spec.ts @@ -2,6 +2,8 @@ ============LICENSE_START========================================== =================================================================== Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + +Copyright (C) 2018 IBM. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -17,7 +19,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -ECOMP is a trademark and service mark of AT&T Intellectual Property. ============LICENSE_END============================================ */ import {OrderBy} from './order-by.pipe'; @@ -59,4 +60,15 @@ describe('OrderByPipe', () => { ] expect(pipe.transform(data,"vnf-type",false)[0]['vnf-type']).toBe('vnf2'); }); + + it('should return whole array when orderby paramater is not set', () => { + const pipe = new OrderBy(); + + let data =[ + {'vnf-type':undefined,'vnfc-type':'vnfc1','artifact-name':'artf1'}, + {'vnf-type':'vnf2','vnfc-type':'vnfc2','artifact-name':'artf2'} + + ] + expect(pipe.transform(data,undefined,false).length).toBe(2); + }); }); |