import { parse } from '../src'; import { bold, paragraph, plain, strike, timestamp, timestampFromHours } from '../src/utils'; test.each([ [``, [paragraph([timestamp('1708551317')])]], [``, [paragraph([timestamp('1708551317', 'R')])]], ['hello ', [paragraph([plain('hello '), timestamp('1708551317')])]], ])('parses %p', (input, output) => { expect(parse(input)).toMatchObject(output); }); test.each([ ['', [paragraph([plain('')])]], ['', [paragraph([plain('')])]], ])('parses %p', (input, output) => { expect(parse(input)).toMatchObject(output); }); test.each([ ['~~', [paragraph([strike([timestamp('1708551317')])])]], ['**', [paragraph([bold([plain('')])])]], ])('parses %p', (input, output) => { expect(parse(input)).toMatchObject(output); }); test.each([ ['', [paragraph([timestamp((Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), 'R')])]], ['', [paragraph([timestamp((Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), 'R')])]], ['', [paragraph([timestamp((Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), 'R')])]], ['', [paragraph([timestamp((Date.parse('2025-07-22T10:00:00+00:00') / 1000).toString(), 'R')])]], ['', [paragraph([timestamp(timestampFromHours('10', '00', '00', '+00:00'), 'R')])]], ['', [paragraph([timestamp(timestampFromHours('10', '00', '00', '+00:00'), 'R')])]], ['', [paragraph([timestamp(timestampFromHours('10', '00', '05', '+00:00'), 't')])]], ['', [paragraph([timestamp(timestampFromHours('10', '00', '00'), 't')])]], [ '', [paragraph([timestamp(((Date.parse('2025-07-24T20:19:58.154+00:00') / 1000) | 0).toString(), 'R')])], ], ])('parses %p', (input, output) => { expect(parse(input)).toMatchObject(output); });