diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2022-09-20 19:43:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 19:43:14 +0300 |
commit | eb21ea9391dcdfb9671c25c4f2c9385b02feff3c (patch) | |
tree | 77d99607fef23218210d4252147562a909b52f79 /src/tests | |
parent | c39d48e2acd59f8ea5682456d31fc1f45c9f4bf9 (diff) | |
parent | 2b5a8f2cdabc9bfca318c84b26032c35accb7e91 (diff) |
Merge pull request #7297 from nextcloud/enh/7143/warning-large-editor-body
GH-7143: Show warning for large signatures
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/unit/components/SignatureSettings.vue.spec.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/tests/unit/components/SignatureSettings.vue.spec.js b/src/tests/unit/components/SignatureSettings.vue.spec.js new file mode 100644 index 000000000..f8e8ce8d8 --- /dev/null +++ b/src/tests/unit/components/SignatureSettings.vue.spec.js @@ -0,0 +1,48 @@ +/* + * @copyright 2022 Daniel Kesselberg <mail@danielkesselberg.de> + * + * @author 2022 Daniel Kesselberg <mail@danielkesselberg.de> + * + * @license AGPL-3.0-or-later + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +import {createLocalVue, shallowMount} from '@vue/test-utils' +import Vuex from 'vuex' +import Nextcloud from '../../../mixins/Nextcloud' +import SignatureSettings from '../../../components/SignatureSettings' + +const localVue = createLocalVue() + +localVue.use(Vuex) +localVue.mixin(Nextcloud) + +describe('SignatureSettings', () => { + + it('Show warning for large signatures', () => { + const wrapper = shallowMount(SignatureSettings, { + localVue, + propsData: { + account: { + aliases: [], + signature: String('<p>Lorem ipsum</p>').repeat(120000), + }, + }, + }) + + expect(wrapper.vm.isLargeSignature).toBeTruthy() + }) + +}) |