diff --git a/lib/presentations.js b/lib/presentations.js index d210512..9947ca7 100644 --- a/lib/presentations.js +++ b/lib/presentations.js @@ -238,7 +238,7 @@ async function _deriveCredentials({ let {acceptedCryptosuites = []} = credentialQuery; if(Array.isArray(acceptedCryptosuites)) { // remove any invalid values; normalize to objects - return acceptedCryptosuites + acceptedCryptosuites = acceptedCryptosuites .filter(e => e && (typeof e === 'string' || e.cryptosuite)) .map(e => typeof e === 'string' ? ({cryptosuite: e}) : e); } else { diff --git a/test/web/35-nfc-data-model.js b/test/web/35-nfc-data-model.js index f640518..25b4c55 100644 --- a/test/web/35-nfc-data-model.js +++ b/test/web/35-nfc-data-model.js @@ -7,7 +7,7 @@ import * as webWallet from '@bedrock/web-wallet'; * Tests for TemplateRenderMethod data model structure validation. * * TemplateRenderMethod structure: - * + * ``` * { * "type": "TemplateRenderMethod", // required. * "renderEngine": "fixed", @@ -18,7 +18,7 @@ import * as webWallet from '@bedrock/web-wallet'; * "mediaType": "application/octet-stream" * } * } - * + * ``` * Note: outputPreference.mode, template requirement, and type validation * are covered in 15-nfc-support.js. * This file focuses on optional fields and field interactions. diff --git a/test/web/40-nfc-legacy-format.js b/test/web/40-nfc-legacy-format.js index 5819dc0..8e2e70e 100644 --- a/test/web/40-nfc-legacy-format.js +++ b/test/web/40-nfc-legacy-format.js @@ -6,17 +6,19 @@ import * as webWallet from '@bedrock/web-wallet'; /** * Tests for NfcRenderingTemplate2024 legacy format backward compatibility. * - * Legacy format (bedrock-web-wallet existing credentials): + * Legacy format (bedrock-web-wallet existing credentials). + * + * ``` * { * "type": "NfcRenderingTemplate2024", * "payload": "z..." | "u..." | "data:..." // required (NOT 'template') * } - * + * ``` * Key differences from TemplateRenderMethod: * - * Uses 'payload' field instead of 'template' - * No outputPreference object required (type implies NFC) - * No renderProperty support + * Uses 'payload' field instead of 'template'. + * No outputPreference object required (type implies NFC). + * No renderProperty support. * * Note: Detection tests (supportsNfc) are in 15-nfc-support.js. * This file focuses on rendering behavior (renderToNfc). diff --git a/test/web/45-nfc-credential.js b/test/web/45-nfc-credential.js index c72c62c..3097abb 100644 --- a/test/web/45-nfc-credential.js +++ b/test/web/45-nfc-credential.js @@ -39,7 +39,7 @@ describe('NFC Renderer', function() { } eadCredential = await response.json(); - console.log('EAD Credential loaded from URL'); + // console.log('EAD Credential loaded from URL'); } catch(error) { console.error('Failed to load EAD credential:', error); this.skip(); @@ -134,7 +134,7 @@ describe('NFC Renderer', function() { } frCredential = await response.json(); - console.log('FirstResponder Credential loaded from URL'); + // console.log('FirstResponder Credential loaded from URL'); } catch(error) { console.error('Failed to load FirstResponder credential:', error); this.skip(); @@ -253,8 +253,8 @@ describe('NFC Renderer', function() { const renderMethods = Array.isArray(eadCredential.renderMethod) ? eadCredential.renderMethod : [eadCredential.renderMethod]; - console.log('EAD renderMethod types:', - renderMethods.map(rm => rm.type)); + // console.log('EAD renderMethod types:', + // renderMethods.map(rm => rm.type)); const nfcMethod = renderMethods.find( rm => rm.type === 'NfcRenderingTemplate2024' @@ -274,8 +274,8 @@ describe('NFC Renderer', function() { const renderMethods = Array.isArray(frCredential.renderMethod) ? frCredential.renderMethod : [frCredential.renderMethod]; - console.log('FirstResponder renderMethod types:', - renderMethods.map(rm => rm.type)); + // console.log('FirstResponder renderMethod types:', + // renderMethods.map(rm => rm.type)); const nfcMethod = renderMethods.find(rm => rm.type === 'TemplateRenderMethod' &&