Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4350 from nextcloud-libraries/fix/3118-scrolled-m…
…odal-should-be-closeable fix(NcModal): Close button should be visible even if modal content is scrolled
- Loading branch information
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { mount } from 'cypress/vue2' | ||
import NcModal from '../../src/components/NcModal/NcModal.vue' | ||
import type { Component } from 'vue' | ||
|
||
describe('NcModal', () => { | ||
it('close button is visible when content is scrolled', () => { | ||
mount(NcModal, { | ||
propsData: { | ||
show: true, | ||
size: 'small', | ||
name: 'Name', | ||
}, | ||
slots: { | ||
// Create two div as children, first is 100vh = overflows the content, second just gets some data attribute so we can scroll into view | ||
default: { | ||
render: (h) => | ||
h('div', [ | ||
h('div', { style: 'height: 100vh;' }), | ||
h('div', { attrs: { 'data-cy': 'bottom' } }), | ||
]), | ||
} as Component, | ||
}, | ||
}) | ||
|
||
cy.get('[data-cy="bottom"]').scrollIntoView() | ||
cy.get('button.modal-container__close').should('be.visible') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters