debian-mirror-gitlab/spec/frontend/fixtures/tabs.rb

27 lines
970 B
Ruby
Raw Normal View History

2022-01-26 12:08:38 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'GlTabsBehavior', '(JavaScript fixtures)', type: :helper do
include JavaScriptFixturesHelpers
include TabHelper
let(:response) { @tabs }
it 'tabs/tabs.html' do
tabs = gl_tabs_nav({ data: { testid: 'tabs' } }) do
gl_tab_link_to('Foo', '#foo', item_active: true, data: { testid: 'foo-tab' }) +
2023-03-04 22:38:38 +05:30
gl_tab_link_to('Bar', '#bar', item_active: false, data: { testid: 'bar-tab' }) +
gl_tab_link_to('Qux', '#qux', item_active: false, data: { testid: 'qux-tab' })
2022-01-26 12:08:38 +05:30
end
panels = content_tag(:div, class: 'tab-content') do
content_tag(:div, 'Foo', { id: 'foo', class: 'tab-pane active', data: { testid: 'foo-panel' } }) +
2023-03-04 22:38:38 +05:30
content_tag(:div, 'Bar', { id: 'bar', class: 'tab-pane', data: { testid: 'bar-panel' } }) +
content_tag(:div, 'Qux', { id: 'qux', class: 'tab-pane', data: { testid: 'qux-panel' } })
2022-01-26 12:08:38 +05:30
end
@tabs = tabs + panels
end
end