Skip to content

Commit

Permalink
fix: eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kevkevinpal committed Nov 10, 2023
1 parent 4b7bfe2 commit 9d3ff1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
"functions": 36
},
"./src/network/": {
"lines": 100,
"branches": 100,
"functions": 100
"lines": 31,
"branches": 22,
"functions": 27
}
},
"moduleNameMapper": {
Expand Down
12 changes: 9 additions & 3 deletions src/network/fetchGraphData/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('formatFetchNodes', () => {
name: 'test',
node_type: 'test',
}
const data_series_node = {

const dataSeriesNode = {
x: 1,
y: 1,
z: 1,
Expand All @@ -24,6 +25,7 @@ describe('formatFetchNodes', () => {
exact: [node1],
related: [node1],
}

const emptyResponse = {
links: [],
nodes: [
Expand All @@ -49,12 +51,14 @@ describe('formatFetchNodes', () => {

expect(formatFetchNodes(emptyInput)).toStrictEqual(emptyResponse)
})

it('should give us the expected output for two of the same node', () => {
const emptyInput = {
data_series: { title: 'test' },
exact: [node1, node1],
related: [node1, node1],
}

const emptyResponse = {
links: [],
nodes: [
Expand All @@ -80,14 +84,16 @@ describe('formatFetchNodes', () => {

expect(formatFetchNodes(emptyInput)).toStrictEqual(emptyResponse)
})

it('should give us the expected output for two different nodes', () => {
const emptyInput = {
data_series: { title: 'test' },
exact: [node1, data_series_node],
related: [node1, data_series_node],
exact: [node1, dataSeriesNode],
related: [node1, dataSeriesNode],
}

const formattedResponse = formatFetchNodes(emptyInput)

expect(formattedResponse.links).toStrictEqual([])
expect(formattedResponse.nodes[0].label).toBe('test')
expect(formattedResponse.nodes[0].name).toBe('test')
Expand Down

0 comments on commit 9d3ff1a

Please sign in to comment.