Skip to content

Commit 7d25561

Browse files
committed
rectify test failure errors
1 parent c2fc8c5 commit 7d25561

File tree

3 files changed

+14
-318
lines changed

3 files changed

+14
-318
lines changed

create-vault.js

Lines changed: 0 additions & 304 deletions
This file was deleted.

src/containers/Vault/VaultHeader/test/VaultHeader.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import i18n from '../../../../i18n/testConfigEnglish'
2222
import SocketContext from '../../../shared/SocketContext'
2323
import { VaultHeader } from '../index'
2424
import { queryClient } from '../../../shared/QueryClient'
25-
import { getLedgerEntry } from '../../../../rippled/lib/rippled'
25+
import { getMPTIssuance } from '../../../../rippled/lib/rippled'
2626
import Mock = jest.Mock
2727

2828
// Mock the rippled library to control API responses
@@ -48,7 +48,7 @@ jest.mock('../../../shared/hooks/useTokenToUSDRate', () => ({
4848
},
4949
}))
5050

51-
const mockedGetLedgerEntry = getLedgerEntry as Mock
51+
const mockedGetMPTIssuance = getMPTIssuance as Mock
5252

5353
// Mock socket client - represents the WebSocket connection to rippled
5454
const mockSocket = {} as any
@@ -83,7 +83,7 @@ describe('VaultHeader Component', () => {
8383
cleanup()
8484

8585
// Default mock: no MPT issuance data (vault credential)
86-
mockedGetLedgerEntry.mockResolvedValue({ node: null })
86+
mockedGetMPTIssuance.mockResolvedValue({ node: null })
8787

8888
// Default mock: XRP to USD rate of 2.0 for predictable conversion tests
8989
mockXRPToUSDRate.mockReturnValue(2.0)
@@ -800,12 +800,12 @@ describe('VaultHeader Component', () => {
800800
describe('Vault Credential Display', () => {
801801
it('displays vault credential when DomainID is present', async () => {
802802
const domainId = 'credential123abc'
803-
mockedGetLedgerEntry.mockResolvedValue({
803+
mockedGetMPTIssuance.mockResolvedValue({
804804
node: { DomainID: domainId },
805805
})
806806

807807
const vaultData = {
808-
Owner: 'rTestOwner',
808+
Account: 'rTestAccount',
809809
Asset: { currency: 'XRP' },
810810
ShareMPTID: 'shareMptId123',
811811
}
@@ -828,7 +828,7 @@ describe('VaultHeader Component', () => {
828828
})
829829

830830
it('does not display credential row when DomainID is absent', async () => {
831-
mockedGetLedgerEntry.mockResolvedValue({
831+
mockedGetMPTIssuance.mockResolvedValue({
832832
node: {}, // No DomainID
833833
})
834834

@@ -873,8 +873,8 @@ describe('VaultHeader Component', () => {
873873
</TestWrapper>,
874874
)
875875

876-
// getLedgerEntry should not be called without ShareMPTID
877-
expect(mockedGetLedgerEntry).not.toHaveBeenCalled()
876+
// getMPTIssuance should not be called without ShareMPTID
877+
expect(mockedGetMPTIssuance).not.toHaveBeenCalled()
878878
})
879879
})
880880

src/registerServiceWorker.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
const isLocalhost = Boolean(
1212
window.location.hostname === 'localhost' ||
13-
// [::1] is the IPv6 localhost address.
14-
window.location.hostname === '[::1]' ||
15-
// 127.0.0.1/8 is considered localhost for IPv4.
16-
window.location.hostname.match(
17-
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
18-
),
13+
// [::1] is the IPv6 localhost address.
14+
window.location.hostname === '[::1]' ||
15+
// 127.0.0.1/8 is considered localhost for IPv4.
16+
window.location.hostname.match(
17+
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
18+
),
1919
)
2020

2121
export default function register() {

0 commit comments

Comments
 (0)