2018-01-31 16:48:18 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'Mermaid rendering', :js do
|
|
|
|
it 'renders Mermaid diagrams correctly' do
|
|
|
|
description = <<~MERMAID
|
|
|
|
```mermaid
|
|
|
|
graph TD;
|
|
|
|
A-->B;
|
|
|
|
A-->C;
|
|
|
|
B-->D;
|
|
|
|
C-->D;
|
|
|
|
```
|
|
|
|
MERMAID
|
|
|
|
|
|
|
|
project = create(:project, :public)
|
|
|
|
issue = create(:issue, project: project, description: description)
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
|
|
|
%w[A B C D].each do |label|
|
2018-11-28 13:39:27 -05:00
|
|
|
expect(page).to have_selector('svg text', text: label)
|
2018-01-31 16:48:18 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|