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

import { resolveWebhookVisibilityLevel } from './admin-webhook-read-helpers.js'

test('resolveWebhookVisibilityLevel marks ignored process errors as ignored', () => {
  assert.equal(resolveWebhookVisibilityLevel('ignored_unconfigured_product'), 'ignored')
  assert.equal(resolveWebhookVisibilityLevel('ignored_duplicate_event'), 'ignored')
})

test('resolveWebhookVisibilityLevel keeps normal and failed events as important', () => {
  assert.equal(resolveWebhookVisibilityLevel(''), 'important')
  assert.equal(resolveWebhookVisibilityLevel('invalid_signature'), 'important')
})
