-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(NcAppSettingsDialog): Make sure sections are correctly labelled
Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
6 changed files
with
78 additions
and
31 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,48 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import { defineComponent } from 'vue' | ||
|
||
import NcAppSettingsDialog from '../../src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue' | ||
import NcAppSettingsSection from '../../src/components/NcAppSettingsSection/NcAppSettingsSection.vue' | ||
|
||
describe('NcAppSettingsDialog', () => { | ||
it('Dialog is correctly labelled', () => { | ||
cy.mount(NcAppSettingsDialog, { | ||
propsData: { | ||
open: true, | ||
name: 'My settings dialog', | ||
}, | ||
slots: { | ||
default: defineComponent({ | ||
render: (h) => h(NcAppSettingsSection, { props: { name: 'First section', id: 'first' } }), | ||
}), | ||
}, | ||
}) | ||
|
||
cy.findByRole('dialog', { name: 'My settings dialog' }).should('exist') | ||
}) | ||
|
||
it('Dialog sections are correctly labelled', () => { | ||
cy.mount(NcAppSettingsDialog, { | ||
propsData: { | ||
open: true, | ||
name: 'My settings dialog', | ||
showNavigation: true, | ||
}, | ||
slots: { | ||
default: defineComponent({ | ||
render: (h) => h(NcAppSettingsSection, { props: { name: 'First section', id: 'first' } }, ['The section content']), | ||
}), | ||
}, | ||
}) | ||
|
||
cy.findByRole('dialog', { name: 'My settings dialog' }).should('exist') | ||
cy.findByRole('dialog', { name: 'My settings dialog' }) | ||
.findByRole('region', { name: 'First section' }) | ||
.should('exist') | ||
.and('contain.text', 'The section content') | ||
}) | ||
}) |
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
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
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
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
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