summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArundathi Patil <arundpil@in.ibm.com>2018-08-08 15:11:01 +0530
committerIBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com>2018-08-08 15:11:09 +0530
commitb445be8e838c20ec6f00121a86abb62a3a2e2554 (patch)
treeea5c444dae09fb9802aad2019cd1dfd80a52b05b
parentbb3646a3933dff23d0d8a967778fa72ad56b1343 (diff)
table-filter pipe : added test case
wrote test case to test table-filter pipe to return proper value when no query parameter is passed Issue-ID: APPC-1064 Change-Id: I29826f3413fd8dfe7b86c6461f0d7a7a237520b4 Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
-rw-r--r--src/app/shared/modules/tidy-table/table-filter.pipe.spec.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/app/shared/modules/tidy-table/table-filter.pipe.spec.ts b/src/app/shared/modules/tidy-table/table-filter.pipe.spec.ts
index 5d73a14..2eee5d1 100644
--- a/src/app/shared/modules/tidy-table/table-filter.pipe.spec.ts
+++ b/src/app/shared/modules/tidy-table/table-filter.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============================================
*/
@@ -42,4 +43,16 @@ describe('TableFilterPipe', () => {
let filter = ['vnf-type', 'vnfc-type', 'artifact-name'];
expect(pipe.transform(data,'vnf1',filter).length).toBe(1);
});
+
+ it('should return entire array when no query is passed..', () => {
+ const pipe = new TableFilterPipe();
+
+ let data =[
+ {'vnf-type':'vnf1','vnfc-type':'vnfc1','artifact-name':'artf1'},
+ {'vnf-type':'vnf2','vnfc-type':'vnfc2','artifact-name':'artf2'}
+
+ ]
+ let filter = ['vnf-type', 'vnfc-type', 'artifact-name'];
+ expect(pipe.transform(data, null, filter).length).toBe(2);
+ });
});