Early out if the description doesn't contain and timestamps

This commit is contained in:
Harry Rose 2026-03-17 19:43:09 +00:00
parent 8710816a6f
commit 7f88d4b036
3 changed files with 24 additions and 3 deletions

View file

@ -1,8 +1,21 @@
const chai = require('chai')
const expect = chai.expect
const parsePodcastDescriptionForChapters = require('../../../../server/utils/parsers/parsePodcastDescriptionForChapters')
const sinon = require('sinon')
const Logger = require('../../../../server/Logger')
describe('parsePodcastDescriptionForChapters', () => {
it("should early out if description doens't contain timestamps", () => {
let loggerDebugStub = sinon.stub(Logger, 'debug')
let description = '<p>Introduction text paragraph 1</p><p>Introduction text paragraph 2</p>'
let chapters = parsePodcastDescriptionForChapters.parse(description, 1000)
expect(chapters).to.be.empty
expect(loggerDebugStub.calledWith('No timestamps found in description, bailing out early')).to.be.true
sinon.restore()
})
var testCasesTestingSuccess = [
{
testName: 'Should handle descriptions using html paragraphs',