Commit 61a4a664 authored by Mark Harding's avatar Mark Harding

(fix): failed tests

1 merge request!440(feat): Client uploader
Pipeline #70286828 running with stages
......@@ -94,10 +94,9 @@ describe('TagPipe', () => {
expect(transformedString).toEqual('<a class="tag" href="/test1" target="_blank">@test1</a> <a class="tag" href="/test2" target="_blank">@test2</a>');
});
fit('should transform many adjacent tags', () => {
it('should transform many adjacent tags', () => {
const pipe = new TagsPipe(featuresServiceMock);
const string = '@test1 @test2 @test3 @test4 @test5 @test6 @test7 @test8 @test9 @test10 @test11 @test12 @test13 @test14 @test15';
console.log(string);
const transformedString = pipe.transform(<any>string);
expect(transformedString).toEqual(`<a class="tag" href="/test1" target="_blank">@test1</a> <a class="tag" href="/test2" target="_blank">@test2</a> `
+ `<a class="tag" href="/test3" target="_blank">@test3</a> <a class="tag" href="/test4" target="_blank">@test4</a> `
......
......@@ -26,6 +26,7 @@ import {TopbarHashtagsService} from "../../hashtags/service/topbar.service";
import {topbarHashtagsServiceMock} from "../../../mocks/modules/hashtags/service/topbar.service.mock";
import { InMemoryStorageService } from "../../../services/in-memory-storage.service";
import { inMemoryStorageServiceMock } from "../../../../tests/in-memory-storage-service-mock.spec";
import { HttpClientTestingModule } from '@angular/common/http/testing';
@Component({
selector: 'minds-third-party-networks-selector',
......@@ -89,6 +90,7 @@ describe('PosterComponent', () => {
FormsModule,
ReactiveFormsModule,
TextInputAutocompleteModule,
HttpClientTestingModule,
],
providers: [
{ provide: Session, useValue: sessionMock },
......
import { AttachmentService } from './attachment';
import { HttpClient } from "@angular/common/http";
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { Inject } from '@angular/core';
import { Client, Upload } from './api';
import { Session } from './session';
......@@ -13,20 +16,25 @@ import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core
describe('Service: Attachment Service', () => {
let service: AttachmentService;
let mockObject;
let httpMock;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AttachmentService ],
imports: [
HttpClientTestingModule,
],
//declarations: [ AttachmentService ],
providers: [
{ provide: Session, useValue: sessionMock },
{ provide: Upload, useValue: uploadMock },
{ provide: Client, useValue: clientMock }
{ provide: Client, useValue: clientMock },
]
});
clientMock.response = {};
clientMock.response[`/api/v1/newsfeed/preview`] = { 'status': 'success' };
service = new AttachmentService(sessionMock, clientMock, uploadMock);
httpMock = TestBed.get(HttpTestingController);
service = new AttachmentService(sessionMock, clientMock, uploadMock, httpMock);
clientMock.get.calls.reset();
clientMock.post.calls.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment