Skip to content

Commit

Permalink
Merge pull request #369 from PermanentOrg/lint/jasmine/no-disabled-tests
Browse files Browse the repository at this point in the history
Enable `jasmine/no-disabled-tests` linting rule
  • Loading branch information
meisekimiu authored Mar 6, 2024
2 parents 3455691 + d321d9c commit 594fda5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports = {
env: { jasmine: true },
rules: {
'jasmine/new-line-before-expect': 'error',
'jasmine/no-disabled-tests': 'error',
// We intend to enable these eventually:
'jasmine/new-line-between-declarations': 'off',
'jasmine/no-disabled-tests': 'off',
'jasmine/no-promise-without-done-fail': 'off',
'jasmine/no-spec-dupes': 'off',
'jasmine/no-unsafe-spy': 'off',
Expand Down
7 changes: 3 additions & 4 deletions src/app/auth/components/logo/logo.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { LogoComponent } from '@auth/components/logo/logo.component';

xdescribe('LogoComponent', () => {
describe('LogoComponent', () => {
let component: LogoComponent;
let fixture: ComponentFixture<LogoComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ LogoComponent ]
})
.compileComponents();
declarations: [LogoComponent],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
17 changes: 6 additions & 11 deletions src/app/auth/components/mfa/mfa.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,23 @@ import { CookieService } from 'ngx-cookie-service';

import { MfaComponent } from '@auth/components/mfa/mfa.component';
import { LogoComponent } from '@auth/components/logo/logo.component';
import { MessageService } from '@shared/services/message/message.service';

xdescribe('MfaComponent', () => {
describe('MfaComponent', () => {
let component: MfaComponent;
let fixture: ComponentFixture<MfaComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [
MfaComponent,
LogoComponent
],
declarations: [MfaComponent, LogoComponent],
imports: [
FormsModule,
ReactiveFormsModule,
HttpClientTestingModule,
RouterTestingModule
RouterTestingModule,
],
providers: [
CookieService
]
})
.compileComponents();
providers: [CookieService, MessageService],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
6 changes: 4 additions & 2 deletions src/app/core/components/nav/nav.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import * as Testing from '@root/test/testbedConfig';
import { cloneDeep } from 'lodash';
import { cloneDeep } from 'lodash';

import { NavComponent } from '@core/components/nav/nav.component';
import { LeftMenuComponent } from '@core/components/left-menu/left-menu.component';
import { RightMenuComponent } from '../right-menu/right-menu.component';

xdescribe('NavComponent', () => {
describe('NavComponent', () => {
let component: NavComponent;
let fixture: ComponentFixture<NavComponent>;

Expand All @@ -14,6 +15,7 @@ xdescribe('NavComponent', () => {

config.declarations.push(NavComponent);
config.declarations.push(LeftMenuComponent);
config.declarations.push(RightMenuComponent);

TestBed.configureTestingModule(config).compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { HttpClientTestingModule } from '@angular/common/http/testing';
import { DIALOG_DATA, DialogRef } from '@root/app/dialog/dialog.service';
import { AccountService } from '@shared/services/account/account.service';
import { ApiService } from '@shared/services/api/api.service';
import { MessageService } from '@shared/services/message/message.service';
import { ArchivePickerComponent } from './archive-picker.component';

xdescribe('ArchivePickerComponent', () => {
describe('ArchivePickerComponent', () => {
let component: ArchivePickerComponent;
let fixture: ComponentFixture<ArchivePickerComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ArchivePickerComponent ]
})
.compileComponents();
declarations: [ArchivePickerComponent],
imports: [HttpClientTestingModule],
providers: [
{ provide: DialogRef, useValue: {} },
{ provide: DIALOG_DATA, useValue: {} },
{ provide: ApiService, useValue: {} },
{ provide: AccountService, useValue: {} },
MessageService,
],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('InlineValueEditComponent', () => {
expect(component.isEditing).toBeFalsy();
});

xit('should set initial date and time based on local time with no timezone passed', () => {
it('should set initial date and time based on local time with no timezone passed', () => {
const displayDT = formatDateISOString('2017-05-13T16:36:29.000000');
component.displayValue = displayDT;
component.type = 'date';
Expand All @@ -168,7 +168,7 @@ describe('InlineValueEditComponent', () => {
expect(component.ngbTime.hour).toBe(momentFormatNum(local, 'H'));
});

xit('should set initial date and time based on timezone', () => {
it('should set initial date and time based on timezone', () => {
const voData: RecordVOData = {
accessRole: 'access.role.owner',
displayDT: '2017-05-13T16:36:29.000000',
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('InlineValueEditComponent', () => {
expect(component.ngbTime.hour).toBe(momentFormatNum(offset, 'H'));
});

xit('should default to current date and time based on timezone', () => {
it('should default to current date and time based on timezone', () => {
const voData: RecordVOData = {
accessRole: 'access.role.owner',
displayDT: null,
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('InlineValueEditComponent', () => {
expect(component.ngbTime.hour).toBe(momentFormatNum(offset, 'H'));
});

xit('should default to current date and time in local timezone when missing timezone', () => {
it('should default to current date and time in local timezone when missing timezone', () => {
const voData: RecordVOData = {
displayDT: null,
accessRole: 'access.role.owner',
Expand Down Expand Up @@ -354,15 +354,16 @@ describe('InlineValueEditComponent', () => {
expect((component.editValue as string).length).toBe(10);
});

xit('should update edit value when time is changed', () => {
it('should update edit value when time is changed', () => {
const voData: RecordVOData = {
accessRole: 'access.role.owner',
displayDT: '2017-05-14T02:36:29.000000',
TimezoneVO: {
dstAbbrev: 'PDT',
dstOffset: '-07:00',
stdAbbrev: 'PST',
stdOffset: '-08:00',
stdAbbrev: 'PDT',
stdOffset: '-07:00',
// Do not use DST so that this test passes all year long.
},
};
const record = new RecordVO(voData);
Expand Down
6 changes: 0 additions & 6 deletions src/app/shared/directives/bg-image-src.directive.spec.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/app/shared/services/prompt/prompt.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { TestBed, inject } from '@angular/core/testing';

import { PromptService } from '@shared/services/prompt/prompt.service';

xdescribe('PromptService', () => {
describe('PromptService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [PromptService]
providers: [PromptService],
});
});

Expand Down

0 comments on commit 594fda5

Please sign in to comment.