File indexing completed on 2025-01-05 04:22:18

0001 /*
0002    SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "richtexteditortest.h"
0008 #include "richtexteditor/richtexteditor.h"
0009 #include <QTest>
0010 
0011 RichTextEditorTest::RichTextEditorTest(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 RichTextEditorTest::~RichTextEditorTest() = default;
0017 
0018 void RichTextEditorTest::shouldHaveDefaultValue()
0019 {
0020     TextCustomEditor::RichTextEditor editor;
0021     QCOMPARE(editor.spellCheckingSupport(), true);
0022     QCOMPARE(editor.textToSpeechSupport(), true);
0023     QCOMPARE(editor.searchSupport(), true);
0024     QCOMPARE(editor.activateLanguageMenu(), true);
0025     QCOMPARE(editor.showAutoCorrectButton(), false);
0026     QCOMPARE(editor.allowTabSupport(), true);
0027     QCOMPARE(editor.webShortcutSupport(), true);
0028     QCOMPARE(editor.emojiSupport(), false);
0029 }
0030 
0031 void RichTextEditorTest::shouldChangeSpellCheckValue()
0032 {
0033     TextCustomEditor::RichTextEditor editor;
0034     editor.setSpellCheckingSupport(false);
0035     QCOMPARE(editor.spellCheckingSupport(), false);
0036 
0037     editor.setTextToSpeechSupport(false);
0038     QCOMPARE(editor.textToSpeechSupport(), false);
0039 
0040     editor.setSearchSupport(false);
0041     QCOMPARE(editor.searchSupport(), false);
0042 
0043     editor.setAllowTabSupport(false);
0044     QCOMPARE(editor.allowTabSupport(), false);
0045 
0046     editor.setWebShortcutSupport(false);
0047     QCOMPARE(editor.webShortcutSupport(), false);
0048 
0049     editor.setSpellCheckingSupport(true);
0050     QCOMPARE(editor.spellCheckingSupport(), true);
0051 
0052     editor.setTextToSpeechSupport(true);
0053     QCOMPARE(editor.textToSpeechSupport(), true);
0054 
0055     editor.setSearchSupport(true);
0056     QCOMPARE(editor.searchSupport(), true);
0057 
0058     editor.setAllowTabSupport(true);
0059     QCOMPARE(editor.allowTabSupport(), true);
0060 
0061     editor.setWebShortcutSupport(true);
0062     QCOMPARE(editor.webShortcutSupport(), true);
0063 }
0064 
0065 QTEST_MAIN(RichTextEditorTest)
0066 
0067 #include "moc_richtexteditortest.cpp"