Skip to content

Commit

Permalink
Merge branch 'chore/cleanup-tests' into 'master'
Browse files Browse the repository at this point in the history
Chipping away at spec test warning messages

See merge request minds/front!1772
  • Loading branch information
markharding committed Feb 11, 2022
2 parents 23a3d47 + 0fea0b0 commit 546681c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sessionMock } from '../../../../tests/session-mock.spec';
import { compassServiceMock } from '../../../mocks/modules/compass/compass.service.mock';
import { Session } from '../../../services/session';
import { Storage } from '../../../services/storage';
import { MockService } from '../../../utils/mock';
import { MockComponent, MockService } from '../../../utils/mock';
import { CompassService } from '../compass.service';

import { CompassQuestionnaireBannerComponent } from './questionnaire-banner.component';
Expand All @@ -16,7 +16,12 @@ describe('CompassQuestionnaireBannerComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CompassQuestionnaireBannerComponent],
declarations: [
CompassQuestionnaireBannerComponent,
MockComponent({
selector: 'm-button',
}),
],
providers: [
{ provide: Session, useValue: sessionMock },
{ provide: CompassService, useValue: compassServiceMock },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { compassServiceMock } from '../../../mocks/modules/compass/compass.service.mock';
import { MockComponent } from '../../../utils/mock';
import { CompassService } from '../compass.service';

import { CompassQuestionnaireModalComponent } from './questionnaire-modal.component';
Expand All @@ -10,7 +11,15 @@ describe('CompassQuestionnaireModalComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CompassQuestionnaireModalComponent],
declarations: [
CompassQuestionnaireModalComponent,
MockComponent({
selector: 'm-button',
}),
MockComponent({
selector: 'm-compassForm',
}),
],
providers: [{ provide: CompassService, useValue: compassServiceMock }],
}).compileComponents();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { compassServiceMock } from '../../../mocks/modules/compass/compass.service.mock';
import { contentSettingsServiceMock } from '../../../mocks/modules/content-settings/content-settings.service.mock';
import { MockService } from '../../../utils/mock';
import { MockComponent, MockService } from '../../../utils/mock';
import { CompassService } from '../../compass/compass.service';
import { DiscoveryTagsService } from '../../discovery/tags/tags.service';
import { TagSettingsService } from '../../tag-settings/tag-settings.service';
Expand All @@ -15,7 +15,16 @@ describe('ContentSettingsComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ContentSettingsComponent],
declarations: [
ContentSettingsComponent,
MockComponent({
selector: 'm-tagSettings',
}),
MockComponent({
selector: 'm-button',
inputs: ['disabled', 'saving'],
}),
],
providers: [
{
provide: ContentSettingsService,
Expand Down
5 changes: 5 additions & 0 deletions src/app/modules/groups/members/members.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { MaterialMock } from '../../../../tests/material-mock.spec';
import { MaterialSwitchMock } from '../../../../tests/material-switch-mock.spec';

import { GroupsMembersModuleComponent } from './members';
import { MockComponent } from '../../../utils/mock';

describe('GroupsMembersModuleComponent', () => {
let fixture: ComponentFixture<GroupsMembersModuleComponent>;
Expand Down Expand Up @@ -62,6 +63,10 @@ describe('GroupsMembersModuleComponent', () => {
MaterialMock,
MaterialSwitchMock,
GroupsMembersModuleComponent,
MockComponent({
selector: 'm-hovercard',
inputs: ['publisher'],
}),
],
imports: [NgCommonModule, RouterTestingModule],
providers: [{ provide: Client, useValue: clientMock }],
Expand Down
12 changes: 10 additions & 2 deletions src/app/modules/settings-v2/other/wallet/wallet.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { sessionMock } from '../../../../../tests/session-mock.spec';
import { FormToastService } from '../../../../common/services/form-toast.service';
import { Session } from '../../../../services/session';
import { MockService } from '../../../../utils/mock';
import { MockComponent, MockService } from '../../../../utils/mock';
import { SettingsV2WalletComponent } from './wallet.component';
import { SettingsV2WalletService } from './wallet.service';

Expand All @@ -18,7 +18,15 @@ describe('SettingsV2WalletComponent', () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [SettingsV2WalletComponent],
declarations: [
SettingsV2WalletComponent,
MockComponent({
selector: 'm-button',
}),
MockComponent({
selector: 'm-formInput__checkbox',
}),
],
providers: [
{ provide: Session, useValue: sessionMock },
{ provide: Router, useValue: routerMock },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockService } from '../../../utils/mock';
import { MockComponent, MockService } from '../../../utils/mock';
import { DiscoveryTagsService } from '../../discovery/tags/tags.service';

import { TagSettingsComponent } from './tag-settings.component';
Expand All @@ -10,7 +10,20 @@ describe('TagSettingsComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [TagSettingsComponent],
declarations: [
TagSettingsComponent,
MockComponent({
selector: 'm-loadingSpinner',
inputs: ['inProgress'],
}),
MockComponent({
selector: 'm-tagSelector',
inputs: ['tags'],
}),
MockComponent({
selector: 'm-hashtags__typeaheadInput',
}),
],
providers: [
{
provide: DiscoveryTagsService,
Expand Down

0 comments on commit 546681c

Please sign in to comment.