Commit a7aa65a1 by Matjaz Gregoric

Emit resize after adjusting mobile window styles in tests.

Adjusting the styles like this does not consistently fire resize events
on the resize detector, so sometimes the block was not sized correctly
in mobile tests. To work around this, manually emit resize event after
preforming the CSS adjustments.
parent 8891cb7a
...@@ -178,6 +178,9 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest): ...@@ -178,6 +178,9 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest):
self.browser.execute_script('$(".wrapper-workbench").css("margin-right", "-{}px")'.format(40 + scrollbar_width)) self.browser.execute_script('$(".wrapper-workbench").css("margin-right", "-{}px")'.format(40 + scrollbar_width))
# And reduce the wasted space around our XBlock in the workbench: # And reduce the wasted space around our XBlock in the workbench:
self.browser.execute_script('return $(".workbench .preview").css("margin", "0")') self.browser.execute_script('return $(".workbench .preview").css("margin", "0")')
# Dynamically adjusting styles causes available screen width to change, but does not always emit
# resize events consistently, so emit resize manually to make sure the block adapts to the new size.
self.browser.execute_script('$(window).resize()')
def _check_mobile_container_size(self): def _check_mobile_container_size(self):
""" Verify that the drag-container tightly fits into the available space. """ """ Verify that the drag-container tightly fits into the available space. """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment