feat: add GuideJar embed support in HC (#13944)
This commit is contained in:
@@ -184,6 +184,32 @@ describe CustomMarkdownRenderer do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when link is a GuideJar embed URL' do
|
||||
let(:guidejar_url) { 'https://www.guidejar.com/embed/i2qMQRp26rtRxpZczmaA' }
|
||||
|
||||
it 'renders an iframe with GuideJar embed code' do
|
||||
output = render_markdown_link(guidejar_url)
|
||||
expect(output).to include('src="https://www.guidejar.com/embed/i2qMQRp26rtRxpZczmaA?type=1&controls=on"')
|
||||
expect(output).to include('allowfullscreen')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when link is a GuideJar guides URL' do
|
||||
let(:guidejar_url) { 'https://guidejar.com/guides/d6a6fdc2-4812-4777-897e-ec1b0c64238f' }
|
||||
|
||||
it 'renders an iframe with GuideJar embed code' do
|
||||
output = render_markdown_link(guidejar_url)
|
||||
expect(output).to include('src="https://www.guidejar.com/embed/d6a6fdc2-4812-4777-897e-ec1b0c64238f?type=1&controls=on"')
|
||||
expect(output).to include('allowfullscreen')
|
||||
end
|
||||
|
||||
it 'wraps iframe in responsive container' do
|
||||
output = render_markdown_link(guidejar_url)
|
||||
expect(output).to include('position: relative; padding-bottom: 62.5%; height: 0;')
|
||||
expect(output).to include('position: absolute; top: 0; left: 0; width: 100%; height: 100%;')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when link is a Bunny.net iframe URL' do
|
||||
let(:bunny_url) { 'https://iframe.mediadelivery.net/play/431789/1f105841-cad9-46fe-a70e-b7623c60797c' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user