File indexing completed on 2024-06-23 04:40:16
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "richtextbrowsertest.h" 0008 #include "richtextbrowser/richtextbrowser.h" 0009 #include <QTest> 0010 0011 QTEST_MAIN(RichTextBrowserTest) 0012 RichTextBrowserTest::RichTextBrowserTest(QObject *parent) 0013 : QObject(parent) 0014 { 0015 } 0016 0017 RichTextBrowserTest::~RichTextBrowserTest() = default; 0018 0019 void RichTextBrowserTest::shouldHaveDefaultValue() 0020 { 0021 TextCustomEditor::RichTextBrowser editor; 0022 QCOMPARE(editor.textToSpeechSupport(), true); 0023 QCOMPARE(editor.searchSupport(), true); 0024 QCOMPARE(editor.webShortcutSupport(), true); 0025 } 0026 0027 void RichTextBrowserTest::shouldChangeSpellCheckValue() 0028 { 0029 TextCustomEditor::RichTextBrowser editor; 0030 0031 editor.setTextToSpeechSupport(false); 0032 QCOMPARE(editor.textToSpeechSupport(), false); 0033 0034 editor.setSearchSupport(false); 0035 QCOMPARE(editor.searchSupport(), false); 0036 0037 editor.setWebShortcutSupport(false); 0038 QCOMPARE(editor.webShortcutSupport(), false); 0039 0040 editor.setTextToSpeechSupport(true); 0041 QCOMPARE(editor.textToSpeechSupport(), true); 0042 0043 editor.setSearchSupport(true); 0044 QCOMPARE(editor.searchSupport(), true); 0045 0046 editor.setWebShortcutSupport(true); 0047 QCOMPARE(editor.webShortcutSupport(), true); 0048 } 0049 0050 #include "moc_richtextbrowsertest.cpp"