File indexing completed on 2024-12-22 04:28:10

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 "plaintexteditortest.h"
0008 #include "plaintexteditor/plaintexteditor.h"
0009 #include <QTest>
0010 
0011 PlainTextEditorTest::PlainTextEditorTest(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 PlainTextEditorTest::~PlainTextEditorTest() = default;
0017 
0018 void PlainTextEditorTest::shouldHaveDefaultValue()
0019 {
0020     TextCustomEditor::PlainTextEditor editor;
0021     QCOMPARE(editor.spellCheckingSupport(), true);
0022     QCOMPARE(editor.textToSpeechSupport(), true);
0023     QCOMPARE(editor.searchSupport(), true);
0024     QCOMPARE(editor.webShortcutSupport(), true);
0025 }
0026 
0027 void PlainTextEditorTest::shouldChangeSpellCheckValue()
0028 {
0029     TextCustomEditor::PlainTextEditor editor;
0030     editor.setSpellCheckingSupport(false);
0031     QCOMPARE(editor.spellCheckingSupport(), false);
0032 
0033     editor.setTextToSpeechSupport(false);
0034     QCOMPARE(editor.textToSpeechSupport(), false);
0035 
0036     editor.setSearchSupport(false);
0037     QCOMPARE(editor.searchSupport(), false);
0038 
0039     editor.setWebShortcutSupport(false);
0040     QCOMPARE(editor.webShortcutSupport(), false);
0041 
0042     editor.setSpellCheckingSupport(true);
0043     QCOMPARE(editor.spellCheckingSupport(), true);
0044 
0045     editor.setTextToSpeechSupport(true);
0046     QCOMPARE(editor.textToSpeechSupport(), true);
0047 
0048     editor.setSearchSupport(true);
0049     QCOMPARE(editor.searchSupport(), true);
0050 
0051     editor.setWebShortcutSupport(true);
0052     QCOMPARE(editor.webShortcutSupport(), true);
0053 }
0054 
0055 QTEST_MAIN(PlainTextEditorTest)
0056 
0057 #include "moc_plaintexteditortest.cpp"