Skip to content

Commit ee7c8d8

Browse files
committed
Added ID for navbar and tests
1 parent 51fe607 commit ee7c8d8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/views/layouts/_navbar.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<li class="nav-item dropdown">
3030
<a class="nav-link dropdown-toggle testid-username" href="#" data-bs-toggle="dropdown"
3131
aria-expanded="false" aria-label="User menu for <%= session[:username] %>"><%= session[:username] %></a>
32-
<ul class="dropdown-menu">
32+
<ul class="dropdown-menu" id="user-dropdown-menu">
3333
<% if current_user.admin? %>
3434
<li><h6 class="dropdown-header">Admin Tools</h6></li>
3535
<li><a class="dropdown-item" href="/admin/blazer">Dashboards</a></li>

features/step_definitions/navigation_steps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
end
1616

1717
Then(/^I should see "(.*?)" in the navbar dropdown$/) do |text|
18-
within('nav .dropdown-menu') do
18+
within('#user-dropdown-menu') do
1919
expect(page).to have_content(text)
2020
end
2121
end
2222

2323
Then(/^I should not see "(.*?)" in the navbar dropdown$/) do |text|
24-
within('nav .dropdown-menu') do
24+
within('#user-dropdown-menu') do
2525
expect(page).not_to have_content(text)
2626
end
2727
end

0 commit comments

Comments
 (0)