Skip to content

Commit

Permalink
chore: fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Apr 16, 2024
1 parent 8251d62 commit 028375e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/features/blocks/pages/block-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { blocksAtom } from '../data'
import { getByDescriptionTerm } from '@/tests/custom-queries/get-description'
import { nextRoundLabel, previousRoundLabel, roundLabel, timestampLabel, transactionsLabel } from '../components/block'
import { transactionsAtom } from '@/features/transactions/data'
import { transactionModelMother } from '@/tests/object-mother/transaction-model'
import { transactionResultMother } from '@/tests/object-mother/transaction-result'

describe('block-page', () => {
describe('when rending a block using an invalid round number', () => {
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('block-page', () => {
it('should be rendered with the correct data', () => {
vi.mocked(useParams).mockImplementation(() => ({ round: block.round.toString() }))
const myStore = createStore()
myStore.set(blocksAtom, new Map([[block.round, block] as const]))
myStore.set(blocksAtom, new Map([[block.round, block]]))

return executeComponentTest(
() => render(<BlockPage />, undefined, myStore),
Expand All @@ -81,7 +81,7 @@ describe('block-page', () => {
})

describe('and has transactions', () => {
const transaction1 = transactionModelMother
const transaction1 = transactionResultMother
.payment()
.withId('zP5UBQ5K7ZHMbJVUAKF5BpdQfwZy4PbhKsDaHMMfOvl3bQoQqrKZ')
.withGroup('W3pIVuWVJlzmMDGvX8St0W/DPxslnpt6vKV8zoFb6rg=')
Expand All @@ -101,8 +101,8 @@ describe('block-page', () => {
it('should be rendered with the correct data', () => {
vi.mocked(useParams).mockImplementation(() => ({ round: block.round.toString() }))
const myStore = createStore()
myStore.set(blocksAtom, new Map([[block.round, block] as const]))
myStore.set(transactionsAtom, new Map([[transaction1.id, transaction1] as const]))
myStore.set(blocksAtom, new Map([[block.round, block]]))
myStore.set(transactionsAtom, new Map([[transaction1.id, transaction1]]))

return executeComponentTest(
() => render(<BlockPage />, undefined, myStore),
Expand Down
2 changes: 1 addition & 1 deletion src/features/transactions/mappers/transaction-mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const asAssetTransferTransaction = (transaction: TransactionResult, asset
closeRemainder: transaction['asset-transfer-transaction']['close-to']
? {
to: transaction['asset-transfer-transaction']['close-to'],
amount: transaction['asset-transfer-transaction']['close-amount'],
amount: transaction['asset-transfer-transaction']['close-amount'] ?? 0,
}
: undefined,
signature: transformSignature(transaction.signature),
Expand Down
2 changes: 1 addition & 1 deletion src/features/transactions/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type CloseAlgoRemainder = {

export type CloseAssetRemainder = {
to: Address
amount: number | bigint | undefined
amount: number | bigint
}

export type PaymentTransactionModel = CommonTransactionProperties & {
Expand Down
16 changes: 8 additions & 8 deletions src/features/transactions/pages/transaction-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('transaction-page', () => {
it('should be rendered with the correct data', () => {
vi.mocked(useParams).mockImplementation(() => ({ transactionId: transaction.id }))
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

return executeComponentTest(
() => {
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('transaction-page', () => {

it('should show the multisig information', () => {
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

return executeComponentTest(
() => {
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('transaction-page', () => {

it('should show 2 tabs with the logicsig base64 as default', () => {
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

return executeComponentTest(
() => {
Expand All @@ -213,7 +213,7 @@ describe('transaction-page', () => {
vi.mocked(algod.disassemble('').do).mockImplementation(() => Promise.resolve({ result: teal }))

const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

return executeComponentTest(
() => {
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('transaction-page', () => {
const base64Note = Buffer.from(note).toString('base64')
const transaction = transactionBuilder.withNote(base64Note).build()
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

beforeEach(() => {
vi.mocked(useParams).mockImplementation(() => ({ transactionId: transaction.id }))
Expand Down Expand Up @@ -291,7 +291,7 @@ describe('transaction-page', () => {
const base64Note = Buffer.from(note).toString('base64')
const transaction = transactionBuilder.withNote(base64Note).build()
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

beforeEach(() => {
vi.mocked(useParams).mockImplementation(() => ({ transactionId: transaction.id }))
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('transaction-page', () => {
const base64Note = Buffer.from(note).toString('base64')
const transaction = transactionBuilder.withNote(base64Note).build()
const myStore = createStore()
myStore.set(transactionsAtom, new Map([[transaction.id, transaction] as const]))
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))

beforeEach(() => {
vi.mocked(useParams).mockImplementation(() => ({ transactionId: transaction.id }))
Expand Down Expand Up @@ -433,7 +433,7 @@ describe('transaction-page', () => {
it('should be rendered with the correct data', () => {
vi.mocked(useParams).mockImplementation(() => ({ transactionId: transaction.id }))
const myStore = createStore()
myStore.set(transactionsAtom, [transaction])
myStore.set(transactionsAtom, new Map([[transaction.id, transaction]]))
myStore.set(assetsAtom, [asset])

return executeComponentTest(
Expand Down

0 comments on commit 028375e

Please sign in to comment.