import { describe, expect, it } from 'vitest'

import { normalizeBridgeRouteEntries, type BridgeRouteCatalog } from './bridgeRoutes'

describe('bridgeRoutesApi helpers', () => {
  it('normalizes WETH9 and WETH10 route tables', () => {
    const routes: BridgeRouteCatalog = {
      weth9: {
        'Ethereum Mainnet (1)': '0x1111111111111111111111111111111111111111',
      },
      weth10: {
        'Base (8453)': '0x2222222222222222222222222222222222222222',
      },
    }

    expect(normalizeBridgeRouteEntries(routes)).toEqual([
      {
        bridge: 'WETH10',
        destination: 'Base (8453)',
        address: '0x2222222222222222222222222222222222222222',
      },
      {
        bridge: 'WETH9',
        destination: 'Ethereum Mainnet (1)',
        address: '0x1111111111111111111111111111111111111111',
      },
    ])
  })
})
