Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 19 additions & 45 deletions __tests__/TestHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,52 +365,26 @@ const TestHelper = {
innerTransactions
};
},
generateNodePeerStatus: isAvailable => {
return {
isAvailable,
lastStatusCheck: 1676809816662
};
},
generateNodeApiStatus: isAvailable => {
return {
isAvailable,
nodePublicKey: '4DA6FB57FA168EEBBCB68DA4DDC8DA7BCF41EC93FB22A33DF510DB0F2670F623',
chainHeight: 2027193,
finalization: {
height: 2031992,
epoch: 1413,
point: 7,
hash: '6B687D9B689611C90A1094A7430E78914F22A2570C80D3E42D520EB08091A973'
},
nodeStatus: {
apiNode: 'up',
db: 'up'
},
restVersion: '2.4.2',
restGatewayUrl: 'localhost.com',
isHttpsEnabled: true
};
},
nodeCommonField: {
version: 16777989,
publicKey: '016DC1622EE42EF9E4D215FA1112E89040DD7AED83007283725CE9BA550272F5',
networkGenerationHashSeed: '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6',
port: 7900,
networkIdentifier: 104,
host: 'node.com',
friendlyName: 'node',
lastAvailable: '2023-02-19T12:36:04.524Z',
hostDetail: {},
location: '',
ip: '127.0.0.1',
organization: '',
as: '',
continent: '',
country: '',
region: '',
city: '',
district: '',
zip: ''
version: '1.0.3.5',
mainPublicKey: '016DC1622EE42EF9E4D215FA1112E89040DD7AED83007283725CE9BA550272F5',
endpoint: 'http://node.com:3000',
finalizedEpoch: 50,
finalizedHash: 'finalized hash',
finalizedHeight: 100,
finalizedPoint: 1,
geoLocation: null,
height: 120,
name: 'node'
},
geoLocationCommonField: {
city: 'ABC City',
continent: 'ABC',
country: 'ABC',
isp: 'ABC Online',
lat: 10.000,
lon: 20.000,
region: 'SN'
}
};

Expand Down
10 changes: 4 additions & 6 deletions __tests__/components/NodesMap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jest.mock('../../src/styles/img/connector_blue_light.png', () => 'blue-light.png
jest.mock('../../src/styles/img/connector_green.png', () => 'green.png');
jest.mock('../../src/styles/img/connector_green_light.png', () => 'green-light.png');

const setupStoreMount = (role, apiStatus) => {
const setupStoreMount = (role, isApiNode) => {
const nodeModule = {
namespaced: true
};
Expand All @@ -36,9 +36,7 @@ const setupStoreMount = (role, apiStatus) => {
const propsData = {
nodes: [{
rolesRaw: role,
apiStatus: {
isAvailable: apiStatus
},
isApiNode,
coordinates: {
latitude: 1,
longitude: 2
Expand All @@ -58,9 +56,9 @@ localVue.use(Vuex);

describe('NodesMap', () => {
describe('addMarkers', () => {
const assertMarkerIcon = (role, apiStatus, expectedIcon) => {
const assertMarkerIcon = (role, isApiNode, expectedIcon) => {
// Arrange:
const wrapper = setupStoreMount(role, apiStatus);
const wrapper = setupStoreMount(role, isApiNode);

// Act:
wrapper.vm.addMarkers();
Expand Down
Loading