Skip to content

Commit ef97777

Browse files
authored
Address review comments
1 parent 959aeee commit ef97777

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Graphs/test/NumberOfIslands.test.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
import { islands } from '../NumberOfIslands'
22

33
describe('Number of Islands', () => {
4-
test('Test Case 1', () => {
4+
test('Graph with three islands', () => {
55
const graph = [
66
['1', '1', '0', '0', '0'],
77
['1', '1', '0', '0', '0'],
88
['0', '0', '1', '0', '0'],
99
['0', '0', '0', '1', '1']
1010
]
11-
const result = islands(graph)
12-
expect(result).toBe(3)
11+
expect(islands(graph)).toBe(3)
1312
})
1413

15-
test('Test Case 2', () => {
14+
test('Graph with only one island', () => {
1615
const graph = [
1716
['1', '1'],
1817
['1', '1'],
1918
['0', '0'],
2019
['0', '0']
2120
]
22-
const result = islands(graph)
23-
expect(result).toBe(1)
21+
expect(islands(graph)).toBe(1)
2422
})
2523

26-
test('Test Case 3', () => {
24+
test('No islands', () => {
2725
const graph = [
2826
['0', '0'],
2927
['0', '0']
3028
]
31-
const result = islands(graph)
32-
expect(result).toBe(0)
29+
expect(islands(graph)).toBe(0)
3330
})
3431
})

0 commit comments

Comments
 (0)