diff --git a/app/assets/javascripts/editor.js b/app/assets/javascripts/editor.js index 28e943353..148e840ec 100644 --- a/app/assets/javascripts/editor.js +++ b/app/assets/javascripts/editor.js @@ -20,6 +20,59 @@ $(document).on('turbolinks:load', function(event) { CodeOceanEditor.initializeEverything(); } + let isMouseDownHorizontal = 0 + $('#resizerHorizontal').on('mousedown', mouseDownHorizontal) + + function mouseDownHorizontal(event) { + isMouseDownHorizontal = 1 + document.body.addEventListener('mousemove', mouseMoveHorizontal) + document.body.addEventListener('mouseup', mouseUpHorizontal) + } + + function mouseMoveHorizontal(event) { + if (isMouseDownHorizontal === 1 && event.clientX <= 0.7 * window.innerWidth && event.clientX >= 0.2 * window.innerWidth) { + event.preventDefault(); + $('#panel-left').css('width', (event.clientX - $('#panel-left').offset().left) + "px") + CodeOceanEditor.resizeSidebars() + CodeOceanEditor.resizeHorizontalResizer() + } else { + mouseUpHorizontal() + } + } + + function mouseUpHorizontal(event) { + isMouseDownHorizontal = 0 + document.body.removeEventListener('mouseup', mouseUpHorizontal) + resizerHorizontal.removeEventListener('mousemove', mouseMoveHorizontal) + } + + let isMouseDownVertical = 0 + $('#resizerVertical').on('mousedown', mouseDownVertical) + + function mouseDownVertical(event) { + isMouseDownVertical = 1 + document.body.addEventListener('mousemove', mouseMoveVertical) + document.body.addEventListener('mouseup', mouseUpVertical) + } + + function mouseMoveVertical(event) { + if (isMouseDownVertical === 1) { + event.preventDefault(); + $('.panel-top').css('height', (event.clientY - $('.panel-top').offset().top - $('#statusbar').height()) + "px") + $('.panel-bottom').height(CodeOceanEditor.calculateEditorHeight('.panel-bottom', false)); + CodeOceanEditor.resizeSidebars() + CodeOceanEditor.resizeHorizontalResizer() + } else { + mouseUpVertical() + } + } + + function mouseUpVertical(event) { + isMouseDownVertical = 0 + document.body.removeEventListener('mouseup', mouseUpVertical) + resizerVertical.removeEventListener('mousemove', mouseMoveVertical) + } + function handleThemeChangeEvent(event) { if (CodeOceanEditor) { CodeOceanEditor.THEME = event.detail.currentTheme === 'dark' ? 'ace/theme/tomorrow_night' : 'ace/theme/tomorrow'; diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index e5f65eea8..4f95ad80d 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -237,10 +237,20 @@ var CodeOceanEditor = { }, resizeSidebars: function () { - $('#content-left-sidebar').height(this.calculateEditorHeight('#content-left-sidebar', false)); + let editorHeightLeftSidebar = this.calculateEditorHeight('#content-left-sidebar', false); + $('#content-left-sidebar').height(function() { + if($('#resizerHorizontal').css('display') === 'none') + return 'auto'; + else + return editorHeightLeftSidebar; + }); $('#content-right-sidebar').height(this.calculateEditorHeight('#content-right-sidebar', false)); }, + resizeHorizontalResizer: function () { + $('#resizerHorizontal').height(this.calculateEditorHeight('#resizerHorizontal', false)); + }, + calculateEditorHeight: function (element, considerStatusbar) { const jqueryElement = $(element); if (jqueryElement.length === 0) { @@ -457,11 +467,18 @@ var CodeOceanEditor = { handleSideBarToggle: function () { const sidebar = $('#sidebar'); sidebar.toggleClass('sidebar-col').toggleClass('sidebar-col-collapsed'); - if (sidebar.hasClass('w-25') || sidebar.hasClass('restore-to-w-25')) { - sidebar.toggleClass('w-25').toggleClass('restore-to-w-25'); - } $('#sidebar-collapsed').toggleClass('d-none'); $('#sidebar-uncollapsed').toggleClass('d-none'); + if ($('#sidebar-uncollapsed').hasClass('d-none')) { + if ($(window).width() >= 992) { + $('#panel-left').css('width', $('#sidebar-collapsed').outerWidth(true)); + } + $('#panel-left').css('padding-bottom', '4px'); + } else { + $('#panel-left').css('width', ''); + $('#panel-left').css('padding-bottom', ''); + } + $('#resizerHorizontal').toggleClass('d-lg-block'); }, initializeRegexes: function () { @@ -541,6 +558,15 @@ var CodeOceanEditor = { }, populateCard: function (card, result, index) { + if (result.stderr && !result.score || result.score < 1) { + card.find('.card-body').toggleClass('d-none'); + card.find('i').toggleClass('fa-chevron-down fa-chevron-right') + } + card.find('.card-header').on('click', ()=>{ + card.find('.card-body').toggleClass('d-none'); + card.find('i').toggleClass('fa-chevron-down fa-chevron-right') + }); + card.addClass(this.getCardClass(result)); card.addClass(`card border-${this.getCardClass(result)}`); card.find('.card-header').addClass(`bg-${this.getCardClass(result)} text-white`); card.find('.card-title .filename').text(result.filename); @@ -927,12 +953,30 @@ var CodeOceanEditor = { $('#output_sidebar_collapsed').addClass('d-none'); $('#output_sidebar_uncollapsed').removeClass('d-none'); $('#output_sidebar').removeClass('output-col-collapsed').addClass('output-col'); + if (window.matchMedia('(min-width: 992px)').matches) { + $('.panel-top').css('height', '50vh'); + $('.panel-bottom').css('height', this.calculateEditorHeight('.panel-bottom', false)); + this.resizeSidebars(); + $('#resizerVertical').removeClass('d-none'); + } else { + $('.panel-bottom').css('height', '50vh'); + $('html, body').animate({scrollTop: $(document).height() - $(window).height()}, 250); + } + this.resizeAceEditors(); }, hideOutputBar: function () { $('#output_sidebar_collapsed').removeClass('d-none'); $('#output_sidebar_uncollapsed').addClass('d-none'); $('#output_sidebar').removeClass('output-col').addClass('output-col-collapsed'); + $('#resizerVertical').addClass('d-none'); + $('.panel-bottom').css('height', $('#output_sidebar_collapsed').height() + 'px'); + if (window.matchMedia('(min-width: 992px)').matches) { + $('.panel-top').css('height', ($('#editor-column').height() - $('.panel-bottom').height()) + "px"); + } else { + $('html, body').animate({scrollTop: $(document).height() - $(window).height()}, 1); + } + this.resizeAceEditors(); }, initializeSideBarTooltips: function () { diff --git a/app/assets/javascripts/editor/evaluation.js b/app/assets/javascripts/editor/evaluation.js index a5ea6ef0e..d64be6445 100644 --- a/app/assets/javascripts/editor/evaluation.js +++ b/app/assets/javascripts/editor/evaluation.js @@ -24,6 +24,8 @@ CodeOceanEditorEvaluation = { $('#score_div').removeClass('d-none'); await this.socketScoreCode(submission.id); }); + this.showOutputBar(); + $('html, body').animate({scrollTop: $(document).height() - $(window).height()}, 500); }, handleScoringResponse: function (results) { diff --git a/app/assets/javascripts/editor/submissions.js b/app/assets/javascripts/editor/submissions.js index abf76b169..911135bca 100644 --- a/app/assets/javascripts/editor/submissions.js +++ b/app/assets/javascripts/editor/submissions.js @@ -189,6 +189,8 @@ CodeOceanEditorSubmissions = { await this.runSubmission(submission); }); + this.showOutputBar(); + $('html, body').animate({scrollTop: $(document).height() - $(window).height()}, 500); }, runSubmission: async function (submission) { diff --git a/app/assets/stylesheets/editor.css.scss b/app/assets/stylesheets/editor.css.scss index 224eba2cc..12f5b0379 100644 --- a/app/assets/stylesheets/editor.css.scss +++ b/app/assets/stylesheets/editor.css.scss @@ -1,6 +1,73 @@ .editor { height: 100%; + max-height: 100%; width: 100%; + display: flex; +} + + + +.btn, #description, #content-left-sidebar, #content-right-sidebar { + border-radius: 5px !important; +} + +#editor-buttons .btn { + margin-left: 2px; +} + +#editor-buttons span { + border-radius: 5px !important; +} + +#editor-column { + max-height: 85vh; +} + +#panel-left { + position: relative; +} + +// Bootstrap breakpoint "large". See https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints +@media (min-width: 992px) { + + #panel-left { + position: relative; + max-height: 85vh; + overflow-y: auto; + } +} + +#panel-right { + position: relative; +} + +#resizerHorizontal { + position: relative; + background: rgb(215, 215, 215); + width: 4px; + display: inline-block; + cursor: col-resize; + padding: 0; +} + +#resizerVertical { + position: relative; + background: rgb(215, 215, 215); + height: 4px; + cursor: row-resize; + margin-bottom: 4px; +} + +.panel-bottom { + overflow: auto; + position: relative; +} + +.panel-top { + overflow: auto; + position: relative; + min-height: 30vh; + max-height: 60vh; } .own-editor { @@ -24,6 +91,7 @@ html[data-bs-theme="light"] { } #content-left-sidebar, #content-right-sidebar { + max-height: 800px; min-height: 250px; } @@ -116,20 +184,17 @@ html[data-bs-theme="light"] { -webkit-transition: width .2s; transition: width .2s; width:67px; - float:left; min-height: 1px; - padding-left: 15px; - padding-right: 15px; + padding-left: 3px; + padding-right: 3px; } .sidebar-col { -webkit-transition: width .2s; transition: width .2s; - width:20%; - float:left; min-height: 1px; - padding-left: 15px; - padding-right: 15px; + padding-left: 3px; + padding-right: 3px; } .editor-col { @@ -142,13 +207,14 @@ html[data-bs-theme="light"] { .output-col { -webkit-transition: width .2s; transition: width .2s; - width:40%; + width:100%; float:right; min-height: 1px; - padding-left: 15px; - padding-right: 15px; + padding-left: 3px; + padding-right: 3px; box-sizing: border-box; margin-left: auto; + min-height: 40vh; } .output-col-collapsed { @@ -157,8 +223,8 @@ html[data-bs-theme="light"] { width:67px; float:right; min-height: 1px; - padding-left: 15px; - padding-right: 15px; + padding-left: 3px; + padding-right: 3px; box-sizing: border-box; margin-left: auto; } diff --git a/app/assets/stylesheets/exercises.css.scss b/app/assets/stylesheets/exercises.css.scss index 94a9a11c0..2490bb19c 100644 --- a/app/assets/stylesheets/exercises.css.scss +++ b/app/assets/stylesheets/exercises.css.scss @@ -16,7 +16,7 @@ input[type='file'] { border-radius: 3px; box-shadow: 0 2px 4px 0 rgba(var(--bs-black-rgb), 0.2); padding: 1px 10px 1px 10px; - margin-bottom: 10px; + margin: 3px 3px 10px 3px; a#toggle { margin-bottom: 5px; diff --git a/app/views/exercises/_editor.html.slim b/app/views/exercises/_editor.html.slim index 05d77a9a9..5d6a81f2f 100644 --- a/app/views/exercises/_editor.html.slim +++ b/app/views/exercises/_editor.html.slim @@ -5,39 +5,41 @@ - hide_rfc_button = @hide_rfc_button || false #editor.row data-exercise-id=@exercise.id data-message-depleted=t('exercises.editor.depleted') data-message-timeout=t('exercises.editor.timeout', permitted_execution_time: @exercise.execution_environment.permitted_execution_time) data-message-out-of-memory=t('exercises.editor.out_of_memory', memory_limit: @exercise.execution_environment.memory_limit) data-submissions-url=submissions_path data-user-external-id=external_user_external_id data-working-times-url=working_times_exercise_path(@exercise) data-intervention-save-url=intervention_exercise_path(@exercise) data-rfc-interventions=show_rfc_interventions data-break-interventions=show_break_interventions data-tips-interventions=show_tips_interventions - - unless @embed_options[:hide_sidebar] - - additional_classes = 'sidebar-col' - - if @tips.blank? - - if @exercise.hide_file_tree - - additional_classes = 'sidebar-col-collapsed' - - else - - additional_classes = 'sidebar-col w-25' - #sidebar class=additional_classes = render('editor_file_tree', exercise: @exercise, files: @files) + div id="panel-left" class="col-12 col-lg-3" + - unless @embed_options[:hide_sidebar] + - additional_classes = 'sidebar-col row' + - if @tips.blank? + - if @exercise.hide_file_tree + - additional_classes = 'sidebar-col-collapsed row' + - else + - additional_classes = 'sidebar-col row' + #sidebar class=additional_classes = render('editor_file_tree', exercise: @exercise, files: @files) - .editor-col.col.p-0#frames - #editor-buttons.btn-group.enforce-bottom-margin - = render('editor_button', disabled: true, icon: 'fa-solid fa-ban', id: 'dummy', label: t('exercises.editor.dummy')) - = render('editor_button', icon: 'fa-solid fa-desktop', id: 'render', label: t('exercises.editor.render')) unless @embed_options[:hide_run_button] - span.flex-grow-1.d-inline-flex#run-stop-button-group data-bs-placement='top' data-bs-toggle='tooltip' data-bs-container='body' title=t('shared.tooltips.shortcut', shortcut: 'ALT + r') - = render('editor_button', data: {'data-message-failure': t('exercises.editor.run_failure'), 'data-message-network': t('exercises.editor.network'), 'data-message-success': t('exercises.editor.run_success')}, icon: 'fa-solid fa-play', id: 'run', label: t('exercises.editor.run'), classes: 'w-100 h-100 btn-primary') unless @embed_options[:disable_run] - = render('editor_button', icon: 'fa-solid fa-stop', id: 'stop', label: t('exercises.editor.stop'), classes: 'w-100 h-100 btn-primary') unless @embed_options[:disable_run] - = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-rocket', id: 'test', label: t('exercises.editor.test'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + t')) unless @embed_options[:disable_run] - = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-trophy', id: 'assess', label: t('exercises.editor.score'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + s')) unless @embed_options[:disable_score] - - unless hide_rfc_button - = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-comment', id: 'requestComments', label: t('exercises.editor.requestComments'), title: t('exercises.editor.requestCommentsTooltip')) + #resizerHorizontal.d-none.d-lg-block + div.col.p-0#frames + #panel-right.col + #editor-buttons.btn-group.enforce-bottom-margin + = render('editor_button', disabled: true, icon: 'fa-solid fa-ban', id: 'dummy', label: t('exercises.editor.dummy')) + = render('editor_button', icon: 'fa-solid fa-desktop', id: 'render', label: t('exercises.editor.render')) unless @embed_options[:hide_run_button] + span.flex-grow-1.overflow-hidden.d-inline-flex#run-stop-button-group data-bs-placement='top' data-bs-toggle='tooltip' data-bs-container='body' title=t('shared.tooltips.shortcut', shortcut: 'ALT + r') + = render('editor_button', data: {'data-message-failure': t('exercises.editor.run_failure'), 'data-message-network': t('exercises.editor.network'), 'data-message-success': t('exercises.editor.run_success')}, icon: 'fa-solid fa-play', id: 'run', label: t('exercises.editor.run'), classes: 'w-100 h-100 btn-primary') unless @embed_options[:disable_run] + = render('editor_button', icon: 'fa-solid fa-stop', id: 'stop', label: t('exercises.editor.stop'), classes: 'w-100 h-100 btn-primary') unless @embed_options[:disable_run] + = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-rocket', id: 'test', label: t('exercises.editor.test'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + t')) unless @embed_options[:disable_run] + = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-trophy', id: 'assess', label: t('exercises.editor.score'), title: t('shared.tooltips.shortcut', shortcut: 'ALT + s')) unless @embed_options[:disable_score] + - unless hide_rfc_button + = render('editor_button', data: {'data-bs-placement': 'top', 'data-bs-toggle': 'tooltip', 'data-bs-container': 'body'}, icon: 'fa-solid fa-comment', id: 'requestComments', label: t('exercises.editor.requestComments'), title: t('exercises.editor.requestCommentsTooltip')) + .panel-top + - @files.each do |file| + - file.read_only = true if @embed_options[:read_only] + = render('editor_frame', exercise:, file:) - - @files.each do |file| - - file.read_only = true if @embed_options[:read_only] - = render('editor_frame', exercise:, file:) - - #statusbar.d-flex.justify-content-between - div - - if !@embed_options[:disable_download] && @exercise.hide_file_tree? - button#download.p-0.border-0.btn-link.visible.bg-body.text-primary - i.fa-solid.fa-arrow-down - = t('exercises.editor.download') - - div + #statusbar.d-flex.justify-content-between + div + - if !@embed_options[:disable_download] && @exercise.hide_file_tree? + button#download.p-0.border-0.btn-link.visible.bg-body.text-primary + i.fa-solid.fa-arrow-down + = t('exercises.editor.download') + div ruby: if current_contributor.programming_group? current_contributor.users.each do |user| @@ -53,15 +55,16 @@ = t('exercises.editor.lastsaved') span#autosave - = ' | ' - - button#start-over-active-file.p-0.border-0.btn-link.bg-body.text-primary data-message-confirm=t('exercises.editor.confirm_start_over_active_file') data-url=reload_exercise_path(@exercise) - i.fa-solid.fa-circle-notch.fa-spin.d-none - i.fa-solid.fa-clock-rotate-left - = t('exercises.editor.start_over_active_file') + = ' | ' - - unless @embed_options[:disable_run] && @embed_options[:disable_score] - .output-col-collapsed#output_sidebar = render('exercises/editor_output') + button#start-over-active-file.p-0.border-0.btn-link.bg-body.text-primary data-message-confirm=t('exercises.editor.confirm_start_over_active_file') data-url=reload_exercise_path(@exercise) + i.fa-solid.fa-circle-notch.fa-spin.d-none + i.fa-solid.fa-clock-rotate-left + = t('exercises.editor.start_over_active_file') + #resizerVertical.d-none + .panel-bottom + - unless @embed_options[:disable_run] && @embed_options[:disable_score] + .output-col-collapsed#output_sidebar = render('exercises/editor_output') - unless @embed_options[:disable_rfc] = render 'shared/modal', diff --git a/app/views/exercises/_editor_file_tree.html.slim b/app/views/exercises/_editor_file_tree.html.slim index be5958e30..55b9964e0 100644 --- a/app/views/exercises/_editor_file_tree.html.slim +++ b/app/views/exercises/_editor_file_tree.html.slim @@ -6,9 +6,28 @@ .d-grid.enforce-bottom-margin#sidebar-uncollapsed class=(@exercise.hide_file_tree && @tips.blank? ? 'd-none' : '') = render('editor_button', classes: 'btn-outline-contrast overflow-hidden mb-2', icon: 'fa-solid fa-square-minus', id: 'sidebar-collapse', label: t('exercises.editor.collapse_action_sidebar')) - #content-left-sidebar.overflow-scroll + - unless @embed_options[:hide_exercise_description] + .exercise.clearfix + .d-lg-flex.flex-row.justify-content-between.align-items-baseline + .col-lg-7 + h1#exercise-headline + i#description-symbol class=(@embed_options[:collapse_exercise_description] ? 'fa-solid fa-chevron-right' : 'fa-solid fa-chevron-down') + = @exercise.title + .col-lg-5.float-lg-end.ms-md-3.mb-md-3.d-flex.justify-content-end.pe-lg-3 + span.badge.rounded-pill.bg-primary.float-end.mt-2.score + + #description-card.lead class=(@embed_options[:collapse_exercise_description] ? 'description-card-collapsed' : 'description-card') + = render_markdown(@exercise.description) + + a#toggle href='#' data-show=t('shared.show') data-hide=t('shared.hide') + - if @embed_options[:collapse_exercise_description] + = t('shared.show') + - else + = t('shared.hide') + + #content-left-sidebar.overflow-auto - unless @exercise.hide_file_tree - .overflow-scroll + .overflow-auto .card.border-secondary .card-header.d-flex.justify-content-between.align-items-center.px-0.py-1 .px-2 = I18n.t('exercises.editor_file_tree.file_root') diff --git a/app/views/exercises/_editor_output.html.slim b/app/views/exercises/_editor_output.html.slim index 99566273d..dc1c853d1 100644 --- a/app/views/exercises/_editor_output.html.slim +++ b/app/views/exercises/_editor_output.html.slim @@ -14,9 +14,10 @@ ul.list-unstyled ul#test-dummies.d-none.list-unstyled li.card.mt-2 - .card-header.py-2 + .card-header.py-2.d-flex.align-items-center + i class='fa-solid fa-chevron-right' h5.card-title.m-0 == t('exercises.implement.test_file', filename: '', number: 0) - .card-body + .card-body.d-none = row(label: 'exercises.implement.passed_tests') do span.number | 0 @@ -34,9 +35,10 @@ /= row(label: 'exercises.implement.output', value: link_to(t('shared.show'), '#')) ul#linter-dummies.d-none.list-unstyled li.card.mt-2 - .card-header.py-2 + .card-header.py-2.d-flex.align-items-center + i class='fa-solid fa-chevron-right' h5.card-title.m-0 == t('exercises.implement.linter_file', filename: '', number: 0) - .card-body + .card-body.d-none = row(label: 'exercises.implement.code_rating') do span.number | 0 diff --git a/app/views/exercises/_tips_content.html.slim b/app/views/exercises/_tips_content.html.slim index a67f6a02b..8181a95de 100644 --- a/app/views/exercises/_tips_content.html.slim +++ b/app/views/exercises/_tips_content.html.slim @@ -5,7 +5,7 @@ - append_javascript_pack_tag('highlight') - append_stylesheet_pack_tag('highlight') -#tips.card.d-block.overflow-scroll role='tab' +#tips.card.d-block.overflow-auto role='tab' .card-header.py-2 i.fa-solid.fa-lightbulb = t('exercises.implement.tips.heading') diff --git a/app/views/exercises/implement.html.slim b/app/views/exercises/implement.html.slim index bc8873e54..605f3e101 100644 --- a/app/views/exercises/implement.html.slim +++ b/app/views/exercises/implement.html.slim @@ -7,11 +7,6 @@ - unless @embed_options[:hide_exercise_description] .exercise.clearfix .d-lg-flex.flex-row.justify-content-between.align-items-baseline - .col-lg-7 - h1#exercise-headline - i#description-symbol class=(@embed_options[:collapse_exercise_description] ? 'fa-solid fa-chevron-right' : 'fa-solid fa-chevron-down') - = @exercise.title - .col-lg-5.float-lg-end.ms-md-3.mb-md-3.d-flex.justify-content-end.pe-lg-3 - if current_contributor.programming_group? span.me-3.mt-1 @@ -28,21 +23,6 @@ i.fa-solid.fa-circle-info = t('programming_groups.new.pair_programming_info') - span.badge.rounded-pill.bg-primary.float-end.mt-2.mb-5.score - - - unless current_contributor.programming_group? - span.badge.rounded-pill.bg-primary.float-end.mt-2.score - - #description-card.lead class=(@embed_options[:collapse_exercise_description] ? 'description-card-collapsed' : 'description-card') - = render_markdown(@exercise.description) - - a#toggle href='#' data-show=t('shared.show') data-hide=t('shared.hide') - - if @embed_options[:collapse_exercise_description] - = t('shared.show') - - else - = t('shared.hide') - - = render('editor', exercise: @exercise, files: @files, submission: @submission) = render 'shared/modal', title: t('programming_groups.new.pair_programming_info'), diff --git a/spec/system/editor_system_spec.rb b/spec/system/editor_system_spec.rb index 1d087e349..045852c6a 100644 --- a/spec/system/editor_system_spec.rb +++ b/spec/system/editor_system_spec.rb @@ -109,4 +109,16 @@ expect(page).to have_no_content(I18n.t('exercises.editor.score')) end end + + context 'contains resizer' do + it 'contains a horizontal resizer' do + visit(implement_exercise_path(exercise)) + expect(page).to have_css('#resizerHorizontal') + end + it 'contains a vertical resizer' do + visit(implement_exercise_path(exercise)) + click_button(I18n.t('exercises.editor.score')) + expect(page).to have_css('#resizerVertical') + end + end end