Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add folder decisions to settings export #797

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 16 additions & 46 deletions src/__tests__/export/ExportRepositoryMock.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,36 @@
import { ExportRepository } from '../../main/modules/export/Repository/ExportRepository';
import { ExportComponentData } from '../../main/model/interfaces/report/ExportComponentData';
import { SettingsComponentData, SettingsFileData, SettingsReplacedComponentFileData } from '../../main/model/interfaces/report/SettingsReport';
import { DecisionData } from '../../main/model/interfaces/report/DecisionData';

export class ExportRepositoryMock implements ExportRepository {
private mockData: {
identifiedData?: ExportComponentData[];
detectedData?: ExportComponentData[];
rawData?: any;
wfpData?: string;
settingsComponentData?: Array<SettingsComponentData>;
settingsFileData?: Array<SettingsFileData>;
settingsDetectedComponentData?:Array<SettingsReplacedComponentFileData>
} = {};
private mockDecisionData: Array<DecisionData>;

constructor(mockData: Partial<ExportRepositoryMock['mockData']> = {}) {
this.mockData = mockData;
this.mockData.settingsComponentData = [];
this.mockData.settingsFileData = [];
this.mockData.settingsDetectedComponentData = [];
constructor() {
this.mockDecisionData = [];
}

public setMockData(newMockData: Partial<ExportRepositoryMock['mockData']>) {
this.mockData = { ...this.mockData, ...newMockData };
public setDecisionMockData(data: Array<DecisionData>) {
this.mockDecisionData = data;
}

public async getIdentifiedData(): Promise<ExportComponentData[]> {
return new Promise<Array<ExportComponentData>>((resolve) => {
resolve(this.mockData.identifiedData);
public async getDecisionData(): Promise<Array<DecisionData>> {
return new Promise<Array<DecisionData>>((resolve) => {
resolve(this.mockDecisionData);
});
}

public async getDetectedData(): Promise<ExportComponentData[]> {
return new Promise<Array<ExportComponentData>>((resolve) => {
resolve(this.mockData.detectedData);
});
getDetectedData(): Promise<ExportComponentData[]> {
return Promise.resolve([]);
}

public getRawData() {
return this.mockData.rawData;
getIdentifiedData(): Promise<ExportComponentData[]> {
return Promise.resolve([]);
}

public getWfpData(): Promise<string> {
return new Promise<string>((resolve) => {
resolve(this.mockData.wfpData);
});
}

public getSettingsComponents(): Promise<Array<SettingsComponentData>> {
return new Promise<Array<SettingsComponentData>>((resolve) => {
resolve(this.mockData.settingsComponentData);
});
getRawData() {
}

public getSettingsIgnoredComponentFiles(purls: Array<string>): Promise<Array<SettingsFileData>> {
return new Promise<Array<SettingsFileData>>((resolve) => {
resolve(this.mockData.settingsFileData);
});
}

public async getSettingsReplacedComponentFiles(): Promise<Array<SettingsReplacedComponentFileData>> {
return new Promise<Array<SettingsReplacedComponentFileData>>((resolve) => {
resolve(this.mockData.settingsDetectedComponentData);
});
getWfpData(): Promise<string> {
return Promise.resolve('');
}
}
216 changes: 0 additions & 216 deletions src/__tests__/export/export.test.test.ts

This file was deleted.

Loading
Loading