import test from 'node:test'
import assert from 'node:assert/strict'

import { resolveShopIdCandidates } from './product-match-service.js'

test('resolveShopIdCandidates merges primary and alias shop ids', () => {
  assert.deepEqual(
    resolveShopIdCandidates({
      shopId: '10',
      shopIdAliases: ['4269276762', '10', ''],
    }),
    ['10', '4269276762'],
  )
})

test('resolveShopIdCandidates preserves wildcard fallback when ids are empty', () => {
  assert.deepEqual(resolveShopIdCandidates({}), [''])
})
