// Test inputs for bytes data validation export const bytesDataInputs = [ { name: 'bytes-data-valid-basic', lexicons: [ { lexicon: 1, id: 'test.bytes.data', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', }, }, }, }, }, }, ], collection: 'test.bytes.data', record: { data: { $bytes: 'MTIz' } }, // "123" in base64 }, { name: 'bytes-data-valid-with-constraints', lexicons: [ { lexicon: 1, id: 'test.bytes.constraints', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', minLength: 10, maxLength: 20, }, }, }, }, }, }, ], collection: 'test.bytes.constraints', record: { data: { $bytes: 'YXNkZmFzZGZhc2RmYXNkZg' } }, // 16 bytes }, { name: 'bytes-data-invalid-plain-string', lexicons: [ { lexicon: 1, id: 'test.bytes.plainstring', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', }, }, }, }, }, }, ], collection: 'test.bytes.plainstring', record: { data: 'green' }, }, { name: 'bytes-data-invalid-empty-object', lexicons: [ { lexicon: 1, id: 'test.bytes.emptyobj', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', }, }, }, }, }, }, ], collection: 'test.bytes.emptyobj', record: { data: {} }, }, { name: 'bytes-data-invalid-too-short', lexicons: [ { lexicon: 1, id: 'test.bytes.tooshort', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', minLength: 10, }, }, }, }, }, }, ], collection: 'test.bytes.tooshort', record: { data: { $bytes: 'b25l' } }, // "one" = 3 bytes }, { name: 'bytes-data-invalid-too-long', lexicons: [ { lexicon: 1, id: 'test.bytes.toolong', defs: { main: { type: 'record', key: 'tid', record: { type: 'object', properties: { data: { type: 'bytes', maxLength: 5, }, }, }, }, }, }, ], collection: 'test.bytes.toolong', record: { data: { $bytes: 'YXNkZmFzZGZhc2RmYXNkZg' } }, // 16 bytes }, ];