Update unit tests for new Dragula

This commit is contained in:
Matt Ross 2018-09-26 09:17:38 -04:00
parent 43abb1773e
commit bc99a1571f
5 changed files with 31 additions and 21 deletions

View File

@ -8,8 +8,8 @@ import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
import { DragulaService } from 'ng2-dragula/ng2-dragula';
import { DragulaModule } from 'ng2-dragula/ng2-dragula';
import { DragulaService } from 'ng2-dragula/dist';
import { DragulaModule } from 'ng2-dragula/dist';
import {
AuthService,
@ -182,4 +182,3 @@ describe('BoardDisplay', () => {
});
});

View File

@ -5,8 +5,8 @@ import { ElementRef } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { DragulaService } from 'ng2-dragula/ng2-dragula';
import { DragulaModule } from 'ng2-dragula/ng2-dragula';
import { DragulaService } from 'ng2-dragula/dist';
import { DragulaModule } from 'ng2-dragula/dist';
import { ColumnDisplay } from '../../../../src/app/board/column/column.component';
import { TaskDisplay } from '../../../../src/app/board/task/task.component';
@ -440,4 +440,3 @@ describe('ColumnDisplay', () => {
});
});

View File

@ -17,15 +17,23 @@ export class RouterMock {
export class DragulaMock {
public opts;
public dropModel = new BehaviorSubject([
{},
{ id: '1' },
{ parentNode: { id: '1' } },
{ parentNode: { id: '1' } }
]);
public dragend = {
subscribe: (fn) => { fn(); }
};
dropModel () {
return {
subscribe: (fn) => {
fn([
{},
{ id: '1' },
{ parentNode: { id: '1' } },
{ parentNode: { id: '1' } }
]);
}
};
}
dragend () {
return { subscribe: (fn) => { fn(); } };
}
find () {
return { drake: {
@ -33,9 +41,13 @@ export class DragulaMock {
} };
}
removeModel () {
return new BehaviorSubject({});
}
destroy () {}
setOptions (name, opts) {
createGroup (_, opts) {
this.opts = opts;
}
}
@ -107,4 +119,3 @@ export class NotificationsServiceMock {
this.noteAdded.next(note);
}
}

View File

@ -3,8 +3,8 @@ import { RouterTestingModule } from '@angular/router/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { FormsModule } from '@angular/forms';
import { DragulaService } from 'ng2-dragula/ng2-dragula';
import { DragulaModule } from 'ng2-dragula/ng2-dragula';
import { DragulaService } from 'ng2-dragula/dist';
import { DragulaModule } from 'ng2-dragula/dist';
import { SharedModule } from '../../../../src/app/shared/shared.module';
@ -301,4 +301,3 @@ describe('BoardAdmin', () => {
});
});

View File

@ -4,6 +4,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { FormsModule } from '@angular/forms';
import { Title } from '@angular/platform-browser';
import { DragulaService } from 'ng2-dragula';
import { Settings } from '../../../src/app/settings/settings.component';
import { SettingsModule } from '../../../src/app/settings/settings.module';
import { SettingsService } from '../../../src/app/settings/settings.service';
@ -23,6 +25,7 @@ describe('Settings', () => {
],
providers: [
Title,
DragulaService,
SettingsService,
{
provide: StringsService,
@ -50,4 +53,3 @@ describe('Settings', () => {
});
});