debian-mirror-gitlab/spec/views/layouts/header/_gitlab_version.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.1 KiB
Ruby
Raw Normal View History

2022-03-02 08:16:31 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/header/_gitlab_version' do
describe 'when show_version_check? is true' do
before do
allow(view).to receive(:show_version_check?).and_return(true)
render
end
it 'renders the version check badge' do
2023-01-13 00:05:48 +05:30
expect(rendered).to have_selector('.js-gitlab-version-check-badge')
2022-03-02 08:16:31 +05:30
end
2022-11-25 23:54:43 +05:30
it 'renders the container as a link' do
expect(rendered).to have_selector(
'a[data-testid="gitlab-version-container"][href="/help/update/index"]'
)
end
2023-01-13 00:05:48 +05:30
it 'renders the container with correct data-tracking attributes' do
expect(rendered).to have_selector(
'a[data-testid="gitlab-version-container"][data-track-action="click_link"]'
)
expect(rendered).to have_selector(
'a[data-testid="gitlab-version-container"][data-track-label="version_help_dropdown"]'
)
expect(rendered).to have_selector(
'a[data-testid="gitlab-version-container"]' \
"[data-track-property=\"#{Gitlab.version_info.major}.#{Gitlab.version_info.minor}\"]"
)
end
2022-03-02 08:16:31 +05:30
end
end