Skip to content

Commit

Permalink
Fix format #3879
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMehl committed Feb 3, 2025
1 parent 7abd0b0 commit 95051ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ describe("loadFileService", () => {

try {
codeChartaService.loadFiles([{ fileName: "DifferentName", content: validFileContent, fileSize: 42 }])
} catch (e) {}
} catch (_) {}

const CCFilesUnderTest = getCCFiles(state.getValue().files)

Expand All @@ -372,7 +372,7 @@ describe("loadFileService", () => {

try {
codeChartaService.loadFiles([{ fileName: "FirstFile", content: validFileContent, fileSize: 42 }])
} catch (e) {}
} catch (_) {}

const filesUnderTest: FileState[] = state.getValue().files

Expand Down Expand Up @@ -604,8 +604,7 @@ describe("loadFileService", () => {
})

it("should load files ignoring the authors attribute", () => {
const testFileContentWithAuthors = TEST_FILE_CONTENT_WITH_AUTHORS
const testJsonWithAuthors = JSON.stringify(testFileContentWithAuthors)
const testJsonWithAuthors = JSON.stringify(TEST_FILE_CONTENT_WITH_AUTHORS)
const expectedFileContentWithoutAuthors = TEST_FILE_CONTENT_WITHOUT_AUTHORS
const ccFile = getCCFileAndDecorateFileChecksum(testJsonWithAuthors)

Expand All @@ -615,8 +614,7 @@ describe("loadFileService", () => {
})

it("should show warnings for files containing the authors attribute", () => {
const testFileContentWithAuthors = TEST_FILE_CONTENT_WITH_AUTHORS
const testJsonWithAuthors = JSON.stringify(testFileContentWithAuthors)
const testJsonWithAuthors = JSON.stringify(TEST_FILE_CONTENT_WITH_AUTHORS)
const expectedFileValidationResult: CCFileValidationResult[] = [
{
fileName: "FirstFile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ function insertIntoSortedState(state: FileState[], file: CCFile) {
const fileState = { file, selectedAs: FileSelectionState.None }
if (index === -1) {
return [...state, fileState]
} else {
return [...state.slice(0, index), fileState, ...state.slice(index)]
}
return [...state.slice(0, index), fileState, ...state.slice(index)]
}

function greaterEqualThan(fileA: CCFile, fileB: CCFile): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("UploadFilesService", () => {
mockFileInput = {
files: [new File([stringify(TEST_FILE_CONTENT)], "test.cc.json", { type: "application/json" })],
click: jest.fn(),
addEventListener: jest.fn((event, callback) => {})
addEventListener: jest.fn((_event, _callback) => {})
} as unknown as HTMLInputElement
;(createCCFileInput as jest.Mock).mockReturnValue(mockFileInput)
})
Expand Down

0 comments on commit 95051ad

Please sign in to comment.