From 4dd9b8f324c0f20322ddef463acba2d0850f28e1 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed Date: Wed, 13 Jun 2018 16:29:50 +0200 Subject: [PATCH] Karma to Jest: playlist_edit_ctrl --- ...rl_specs.ts => playlist_edit_ctrl.jest.ts} | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) rename public/app/features/playlist/specs/{playlist_edit_ctrl_specs.ts => playlist_edit_ctrl.jest.ts} (70%) diff --git a/public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts b/public/app/features/playlist/specs/playlist_edit_ctrl.jest.ts similarity index 70% rename from public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts rename to public/app/features/playlist/specs/playlist_edit_ctrl.jest.ts index 7884dd090e5..f313c6e8e6a 100644 --- a/public/app/features/playlist/specs/playlist_edit_ctrl_specs.ts +++ b/public/app/features/playlist/specs/playlist_edit_ctrl.jest.ts @@ -1,5 +1,4 @@ import '../playlist_edit_ctrl'; -import { describe, beforeEach, it, expect } from 'test/lib/common'; import { PlaylistEditCtrl } from '../playlist_edit_ctrl'; describe('PlaylistEditCtrl', () => { @@ -20,13 +19,13 @@ describe('PlaylistEditCtrl', () => { describe('searchresult returns 2 dashboards, ', () => { it('found dashboard should be 2', () => { - expect(ctx.dashboardresult.length).to.be(2); + expect(ctx.dashboardresult.length).toBe(2); }); it('filtred result should be 2', () => { ctx.filterFoundPlaylistItems(); - expect(ctx.filteredDashboards.length).to.be(2); - expect(ctx.filteredTags.length).to.be(2); + expect(ctx.filteredDashboards.length).toBe(2); + expect(ctx.filteredTags.length).toBe(2); }); describe('adds one dashboard to playlist, ', () => { @@ -37,16 +36,16 @@ describe('PlaylistEditCtrl', () => { }); it('playlistitems should be increased by one', () => { - expect(ctx.playlistItems.length).to.be(2); + expect(ctx.playlistItems.length).toBe(2); }); it('filtred playlistitems should be reduced by one', () => { - expect(ctx.filteredDashboards.length).to.be(1); - expect(ctx.filteredTags.length).to.be(1); + expect(ctx.filteredDashboards.length).toBe(1); + expect(ctx.filteredTags.length).toBe(1); }); it('found dashboard should be 2', () => { - expect(ctx.dashboardresult.length).to.be(2); + expect(ctx.dashboardresult.length).toBe(2); }); describe('removes one dashboard from playlist, ', () => { @@ -57,14 +56,14 @@ describe('PlaylistEditCtrl', () => { }); it('playlistitems should be increased by one', () => { - expect(ctx.playlistItems.length).to.be(0); + expect(ctx.playlistItems.length).toBe(0); }); it('found dashboard should be 2', () => { - expect(ctx.dashboardresult.length).to.be(2); - expect(ctx.filteredDashboards.length).to.be(2); - expect(ctx.filteredTags.length).to.be(2); - expect(ctx.tagresult.length).to.be(2); + expect(ctx.dashboardresult.length).toBe(2); + expect(ctx.filteredDashboards.length).toBe(2); + expect(ctx.filteredTags.length).toBe(2); + expect(ctx.tagresult.length).toBe(2); }); }); });