Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jul 12, 2024
1 parent dbf0027 commit 0559f90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/services/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class NodeService {
}
}

private isCkbCompatibility(neuronVersion: string, externalCKBVersion: string, type: CKBNodeType) {
private isCkbCompatibility(neuronVersion: string, externalCKBVersion: string, type: CKBNodeType = 'full') {
const compatibilities = this.getNeuronCompatibilityCKB()
const neuronCompatibleVersion = neuronVersion.split('.').slice(0, 2).join('.')
const externalCKBCompatibleVersion = externalCKBVersion.split('.').slice(0, 2).join('.')
Expand Down
7 changes: 7 additions & 0 deletions packages/neuron-wallet/tests/services/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ describe('NodeService', () => {
nodeService.getNeuronCompatibilityCKB = () => ({
'0.110': {
full: ['0.110', '0.109'],
light: ['0.3', '0.2'],
},
})
stubbedNetworsServiceGet.mockReturnValueOnce({ remote: BUNDLED_CKB_URL, readonly: true })
Expand All @@ -489,6 +490,12 @@ describe('NodeService', () => {
it('is compatible', () => {
expect(nodeService.isCkbCompatibility('0.110.0', '0.109.0 (30e1255 2023-01-30)')).toBeTruthy()
})
it('is not compatible', () => {
expect(nodeService.isCkbCompatibility('0.110.0', '0.1', 'light')).toBeFalsy()
})
it('is compatible', () => {
expect(nodeService.isCkbCompatibility('0.110.0', '0.3', 'light')).toBeTruthy()
})
})
describe('test should update', () => {
beforeEach(() => {
Expand Down

1 comment on commit 0559f90

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 9903358759

Please sign in to comment.