Skip to content

Commit 171621c

Browse files
committed
refactor: update tests for new citations metrics processing
1 parent 3d2513d commit 171621c

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

vis/test/datamanagers/countmetrics.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
describe("The private function __countMetrics of the DataManager (with PubMed)", () => {
1616
const setupAndRunCountMetrics = (
17-
paper: PubmedPaper = MOCK_PUBMED_PAPER_DATA
17+
paper: PubmedPaper = MOCK_PUBMED_PAPER_DATA,
1818
): PubmedPaper => {
1919
// Create the instance of DataManager class
2020
const dataManager = new DataManager(productionKMConfig);
@@ -133,7 +133,7 @@ describe("The private function __countMetrics of the DataManager (with PubMed)",
133133

134134
it("Works when readers data was provided, but it is invalid", () => {
135135
// Defining expected result
136-
const EXPECTED_RESULT = "n/a";
136+
const EXPECTED_RESULT = 0;
137137

138138
// Modifying paper data
139139
const modifiedMockPaperData: PubmedPaper = {
@@ -203,7 +203,7 @@ describe("The private function __countMetrics of the DataManager (with PubMed)",
203203

204204
it("Works when readers data was provided, but it is invalid", () => {
205205
// Defining expected result
206-
const EXPECTED_RESULT = "n/a";
206+
const EXPECTED_RESULT = 0;
207207

208208
// Modifying paper data
209209
const modifiedMockPaperData: PubmedPaper = {
@@ -223,7 +223,7 @@ describe("The private function __countMetrics of the DataManager (with PubMed)",
223223

224224
describe("The private function __countMetrics of the DataManager (with BASE)", () => {
225225
const setupAndRunCountMetrics = (
226-
paper: BasePaper = MOCK_BASE_PAPER_DATA
226+
paper: BasePaper = MOCK_BASE_PAPER_DATA,
227227
): BasePaper => {
228228
// Create the instance of DataManager class
229229
const dataManager = new DataManager(productionKMConfig);
@@ -342,7 +342,7 @@ describe("The private function __countMetrics of the DataManager (with BASE)", (
342342

343343
it("Works when readers data was provided, but it is invalid", () => {
344344
// Defining expected result
345-
const EXPECTED_RESULT = "n/a";
345+
const EXPECTED_RESULT = 0;
346346

347347
// Modifying paper data
348348
const modifiedMockPaperData: BasePaper = {
@@ -412,7 +412,7 @@ describe("The private function __countMetrics of the DataManager (with BASE)", (
412412

413413
it("Works when readers data was provided, but it is invalid", () => {
414414
// Defining expected result
415-
const EXPECTED_RESULT = "n/a";
415+
const EXPECTED_RESULT = 0;
416416

417417
// Modifying paper data
418418
const modifiedMockPaperData: BasePaper = {
@@ -432,7 +432,7 @@ describe("The private function __countMetrics of the DataManager (with BASE)", (
432432

433433
describe("The private function __countMetrics of the DataManager (with ORCID)", () => {
434434
const setupAndRunCountMetrics = (
435-
paper: OrcidPaper = MOCK_ORCID_PAPER_DATA
435+
paper: OrcidPaper = MOCK_ORCID_PAPER_DATA,
436436
): OrcidPaper => {
437437
// Create the instance of DataManager class
438438
const dataManager = new DataManager(productionKMConfig);
@@ -573,7 +573,7 @@ describe("The private function __countMetrics of the DataManager (with ORCID)",
573573

574574
it("Works when readers data was provided, but it is invalid", () => {
575575
// Defining expected result
576-
const EXPECTED_RESULT = "n/a";
576+
const EXPECTED_RESULT = 0;
577577

578578
// Modifying paper data
579579
const modifiedMockPaperData: OrcidPaper = {
@@ -643,7 +643,7 @@ describe("The private function __countMetrics of the DataManager (with ORCID)",
643643

644644
it("Works when readers data was provided, but it is invalid", () => {
645645
// Defining expected result
646-
const EXPECTED_RESULT = "n/a";
646+
const EXPECTED_RESULT = 0;
647647

648648
// Modifying paper data
649649
const modifiedMockPaperData: OrcidPaper = {

vis/test/store/data.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, describe, it } from 'vitest';
1+
import { expect, describe, it } from "vitest";
22

33
import { initializeStore, updateDimensions } from "../../js/actions";
44

@@ -23,7 +23,7 @@ describe("data state", () => {
2323
it("should resize the papers correctly with no data", () => {
2424
const result = reducer(
2525
{ list: [], options: {}, size: null },
26-
updateDimensions({ size: 500 }, {})
26+
updateDimensions({ size: 500 }, {}),
2727
);
2828

2929
expect(result).toEqual({ list: [], options: {}, size: null });
@@ -32,7 +32,7 @@ describe("data state", () => {
3232
it("should not resize the papers if streamgraph", () => {
3333
const result = reducer(
3434
{ list: [{}], options: { isStreamgraph: true }, size: null },
35-
updateDimensions({ size: 500 }, {})
35+
updateDimensions({ size: 500 }, {}),
3636
);
3737

3838
expect(result).toEqual({
@@ -55,8 +55,8 @@ describe("data state", () => {
5555
500,
5656
500,
5757
500,
58-
{}
59-
)
58+
{},
59+
),
6060
);
6161

6262
expect(result).toEqual({
@@ -258,9 +258,9 @@ const RESIZED_DATA = {
258258
"http://mendeley.com/catalog/a-survey-of-current-research-on-online-communities-of-practice",
259259
comments_for_filtering: "",
260260
resized: false,
261-
diameter: 38.46153846153847,
262-
width: 28.623400289817337,
263-
height: 38.164533719756456,
261+
diameter: 18.461538461538463,
262+
width: 13.739232139112323,
263+
height: 18.3189761854831,
264264
zoomedX: NaN,
265265
zoomedY: NaN,
266266
zoomedWidth: NaN,

0 commit comments

Comments
 (0)