Commit 94ad0af7 authored by Stan Hu's avatar Stan Hu

Test that external images are preserved

parent b8452bf3
...@@ -26,7 +26,7 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do ...@@ -26,7 +26,7 @@ RSpec.describe 'Raw files', '(JavaScript fixtures)' do
end end
it 'blob/notebook/markdown-table.json' do it 'blob/notebook/markdown-table.json' do
@blob = project.repository.blob_at('b0316785', 'files/ipython/markdown-table.ipynb') @blob = project.repository.blob_at('f6b7a707', 'files/ipython/markdown-table.ipynb')
end end
it 'blob/notebook/worksheets.json' do it 'blob/notebook/worksheets.json' do
......
...@@ -65,18 +65,23 @@ describe('Markdown component', () => { ...@@ -65,18 +65,23 @@ describe('Markdown component', () => {
return vm.$nextTick().then(() => { return vm.$nextTick().then(() => {
const images = vm.$el.querySelectorAll('img'); const images = vm.$el.querySelectorAll('img');
expect(images.length).toBe(3); expect(images.length).toBe(5);
const columns = vm.$el.querySelectorAll('td'); const columns = vm.$el.querySelectorAll('td');
expect(images.length).toBe(3); expect(columns.length).toBe(6);
expect(columns[0].textContent).toEqual('Hello '); expect(columns[0].textContent).toEqual('Hello ');
expect(columns[1].textContent).toEqual('Test '); expect(columns[1].textContent).toEqual('Test ');
expect(columns[2].textContent).toEqual('World '); expect(columns[2].textContent).toEqual('World ');
expect(columns[3].textContent).toEqual('Fake ');
expect(columns[4].textContent).toEqual('External image: ');
expect(columns[5].textContent).toEqual('Empty');
expect(columns[0].innerHTML).toContain('<img src="data:image/jpeg;base64'); expect(columns[0].innerHTML).toContain('<img src="data:image/jpeg;base64');
expect(columns[1].innerHTML).toContain('<img src="data:image/png;base64'); expect(columns[1].innerHTML).toContain('<img src="data:image/png;base64');
expect(columns[2].innerHTML).toContain('<img src="data:image/jpeg;base64'); expect(columns[2].innerHTML).toContain('<img src="data:image/jpeg;base64');
expect(columns[3].innerHTML).toContain('<img>');
expect(columns[4].innerHTML).toContain('<img src="https://www.google.com/');
}); });
}); });
}); });
......
...@@ -52,7 +52,7 @@ module TestEnv ...@@ -52,7 +52,7 @@ module TestEnv
'wip' => 'b9238ee', 'wip' => 'b9238ee',
'csv' => '3dd0896', 'csv' => '3dd0896',
'v1.1.0' => 'b83d6e3', 'v1.1.0' => 'b83d6e3',
'add-ipython-files' => 'b031678', 'add-ipython-files' => 'f6b7a70',
'add-pdf-file' => 'e774ebd', 'add-pdf-file' => 'e774ebd',
'squash-large-files' => '54cec52', 'squash-large-files' => '54cec52',
'add-pdf-text-binary' => '79faa7b', 'add-pdf-text-binary' => '79faa7b',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment