Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fdewas-aneo committed Dec 13, 2024
1 parent 21e35fa commit 27f0019
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/app/applications/components/table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('TasksTableComponent', () => {
});

it('should get data', () => {
expect(component.data()).toEqual(mockApplicationsDataService.data);
expect(component.data).toEqual(mockApplicationsDataService.data);
});

it('should get total', () => {
Expand All @@ -233,6 +233,6 @@ describe('TasksTableComponent', () => {
});

it('should get displayedColumns', () => {
expect(component.displayedColumns).toEqual(displayedColumns);
expect(component.columns).toEqual(displayedColumns);
});
});
4 changes: 2 additions & 2 deletions src/app/partitions/components/table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PartitionsTableComponent } from './table.component';
import PartitionsDataService from '../services/partitions-data.service';
import { PartitionRaw } from '../types';

describe('TasksTableComponent', () => {
describe('PartitionsTableComponent', () => {
let component: PartitionsTableComponent;

const displayedColumns: TableColumn<PartitionRaw>[] = [
Expand Down Expand Up @@ -190,6 +190,6 @@ describe('TasksTableComponent', () => {
});

it('should get displayedColumns', () => {
expect(component.displayedColumns).toEqual(displayedColumns);
expect(component.columns).toEqual(displayedColumns);
});
});
7 changes: 4 additions & 3 deletions src/app/results/components/table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ResultsDataService from '../services/results-data.service';
import { ResultsStatusesService } from '../services/results-statuses.service';
import { ResultRaw } from '../types';

describe('TasksTableComponent', () => {
describe('ResultsTableComponent', () => {
let component: ResultsTableComponent;

const displayedColumns: TableColumn<ResultRaw>[] = [
Expand Down Expand Up @@ -71,6 +71,7 @@ describe('TasksTableComponent', () => {
}).inject(ResultsTableComponent);

component.displayedColumns = displayedColumns;
component.ngOnInit();
});

it('should run', () => {
Expand Down Expand Up @@ -112,7 +113,7 @@ describe('TasksTableComponent', () => {
});

it('should get data', () => {
expect(component.data()).toEqual(mockResultsDataService.data);
expect(component.data).toEqual(mockResultsDataService.data);
});

it('should get total', () => {
Expand All @@ -132,6 +133,6 @@ describe('TasksTableComponent', () => {
});

it('should get displayedColumns', () => {
expect(component.displayedColumns).toEqual(displayedColumns);
expect(component.columns).toEqual(displayedColumns);
});
});
4 changes: 2 additions & 2 deletions src/app/sessions/components/table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ describe('SessionsTableComponent', () => {
});

it('should get data', () => {
expect(component.data()).toEqual(mockSessionsDataService.data);
expect(component.data).toEqual(mockSessionsDataService.data);
});

it('should get total', () => {
Expand All @@ -358,6 +358,6 @@ describe('SessionsTableComponent', () => {
});

it('should get displayedColumns', () => {
expect(component.displayedColumns).toEqual(displayedColumns);
expect(component.columns).toEqual(displayedColumns);
});
});
3 changes: 1 addition & 2 deletions src/app/sessions/index.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,8 @@ describe('Sessions Index Component', () => {
});

it('should refresh if duration is included', () => {
const spy = jest.spyOn(component.refresh$, 'next');
component.onColumnsChange(['duration']);
expect(spy).toHaveBeenCalled();
expect(mockSessionsDataService.refresh$.next).toHaveBeenCalled();
});
});

Expand Down
6 changes: 4 additions & 2 deletions src/app/tasks/components/table.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ describe('TasksTableComponent', () => {

component.displayedColumns = displayedColumns;
component.selection = [];

component.ngOnInit();
});

it('should run', () => {
Expand Down Expand Up @@ -272,7 +274,7 @@ describe('TasksTableComponent', () => {
});

it('should get data', () => {
expect(component.data()).toEqual(mockTasksDataService.data);
expect(component.data).toEqual(mockTasksDataService.data);
});

it('should get total', () => {
Expand All @@ -292,6 +294,6 @@ describe('TasksTableComponent', () => {
});

it('should get displayedColumns', () => {
expect(component.displayedColumns).toEqual(displayedColumns);
expect(component.columns).toEqual(displayedColumns);
});
});

0 comments on commit 27f0019

Please sign in to comment.