Fixes #3668 - The defined ignored attributes in the popover context are not working.

This commit is contained in:
Dominik Klein 2021-07-21 18:12:41 +02:00 committed by Thorsten Eckel
parent 4ab01e3638
commit ea30bf80bf
3 changed files with 23 additions and 1 deletions

View file

@ -25,6 +25,7 @@ class App.SingleObjectPopoverProvider extends App.PopoverProvider
buildContentFor: (elem) ->
id = @objectIdFor(elem)
object = @constructor.klass.fullLocal(id)
ignoredAttributes = @constructor.ignoredAttributes
# get display data
data = _.values(@constructor.klass.attributesGet('view'))
@ -37,7 +38,7 @@ class App.SingleObjectPopoverProvider extends App.PopoverProvider
# add to show if value exists
# do not show ignroed attributes
object[name] && attr.shown && !_.include(@constructor.ignoredAttributes, name)
object[name] && attr.shown && !_.include(ignoredAttributes, name)
@buildHtmlContent(
object: object

View file

@ -270,6 +270,19 @@ module CommonActions
modal_disappear(timeout: timeout) if disappears
end
# Show the popover on hover
#
# @example
# popover_on_hover(page.find('button.hover_me'))
#
def popover_on_hover(element, wait_for_popover_killer: true)
# wait for popover killer to pass
sleep 3 if wait_for_popover_killer
move_mouse_to(element)
move_mouse_by(5, 5)
end
end
RSpec.configure do |config|

View file

@ -33,4 +33,12 @@ RSpec.describe 'User Profile', type: :system do
end
end
end
it 'check that ignored attributes for user popover are not visible' do
fill_in id: 'global-search', with: customer.firstname
popover_on_hover(find('.nav-tab--search.user'))
expect(page).to have_css('.popover label', count: 1)
end
end