Skip to content

Commit 0e1211d

Browse files
committed
updates unit tests
1 parent 773725e commit 0e1211d

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

src/browser/modules/Stream/CypherFrame/gqlStatusUtils.test.ts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,37 @@ describe('gql status formatting', () => {
5858
)
5959
})
6060

61-
test('formats a title from a gql status description with no matches correctly', () => {
61+
test('formats a description with line breaks correctly', () => {
62+
const gqlStatusDescription = `error: general processing exception - unexpected error. The shortest path algorithm does not work when the start and end nodes are the same. This can happen if you
63+
perform a shortestPath search after a cartesian product that might have the same start and end nodes for some
64+
of the rows passed to shortestPath.`
65+
66+
const result =
67+
formatDescriptionFromGqlStatusDescription(gqlStatusDescription)
68+
69+
expect(result)
70+
.toEqual(`The shortest path algorithm does not work when the start and end nodes are the same. This can happen if you
71+
perform a shortestPath search after a cartesian product that might have the same start and end nodes for some
72+
of the rows passed to shortestPath.`)
73+
})
74+
75+
test('formats a title from a gql status description with no error|info|warn prefix correctly', () => {
6276
const gqlStatusDescription =
63-
'Unfortunately, no one can be told what the Matrix is. You have to see it for yourself'
77+
'Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.'
78+
6479
const result = formatTitleFromGqlStatusDescription(gqlStatusDescription)
6580

66-
expect(result).toEqual('')
81+
expect(result).toEqual(
82+
'Unfortunately, no one can be told what the Matrix is'
83+
)
6784
})
6885

69-
test('formats a description from a gql status description with no matches correctly', () => {
70-
const gqlStatusDescription = 'Believe the unbelievable'
71-
const result =
72-
formatDescriptionFromGqlStatusDescription(gqlStatusDescription)
86+
test('formats a description from a gql status description with no error|info|warn correctly', () => {
87+
const gqlStatusDescription =
88+
'Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.'
89+
90+
const result = formatTitleFromGqlStatusDescription(gqlStatusDescription)
7391

74-
expect(result).toEqual('')
92+
expect(result).toEqual('You have to see it for yourself.')
7593
})
7694
})

0 commit comments

Comments
 (0)