-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wallet/desktop] fix: offline transaction - fill information about av…
…ailable plugins for mainnet and testnet (#1981)
- Loading branch information
1 parent
786617a
commit 00213e5
Showing
2 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { NetworkType } from 'symbol-sdk'; | ||
import { OfflineNetworkProperties } from '@/services/offline/MockModels'; | ||
import { NetworkConfigurationHelpers } from '@/core/utils/NetworkConfigurationHelpers'; | ||
import { networkConfig } from '@/config'; | ||
|
||
describe('core/utils/NetworkConfigurationHelpers', () => { | ||
describe('epochAdjustment()', () => { | ||
test('should return default value when no network configuration passed', () => { | ||
// Arrange + Act: | ||
const epochAdjustment = NetworkConfigurationHelpers.epochAdjustment(undefined, 100); | ||
// Assert: | ||
expect(epochAdjustment).toBe(100); | ||
}); | ||
|
||
test('should return epoch adjustment for mainnet', () => { | ||
// Arrange: | ||
const offlineNetworkConfiguration = OfflineNetworkProperties[NetworkType.MAIN_NET]; | ||
// Act: | ||
const epochAdjustment = NetworkConfigurationHelpers.epochAdjustment(offlineNetworkConfiguration, 100); | ||
// Assert: | ||
expect(epochAdjustment).toBe(networkConfig[NetworkType.MAIN_NET].networkConfigurationDefaults.epochAdjustment); | ||
}); | ||
|
||
test('should return epoch adjustment for testnet', () => { | ||
// Arrange: | ||
const offlineNetworkConfiguration = OfflineNetworkProperties[NetworkType.TEST_NET]; | ||
// Act: | ||
const epochAdjustment = NetworkConfigurationHelpers.epochAdjustment(offlineNetworkConfiguration, 100); | ||
// Assert: | ||
expect(epochAdjustment).toBe(networkConfig[NetworkType.TEST_NET].networkConfigurationDefaults.epochAdjustment); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters