diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-11 11:31:14 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-11 11:44:31 +0530 |
| commit | 12d0ce37db7323e8efd56d6a698a98abcb8d680b (patch) | |
| tree | ec2102d40326a332b2ecb976869585f81cba8574 /spec | |
| parent | 971854bfefad4c644ac3d5f5d6003f24d551bf1d (diff) | |
| download | null-browser-12d0ce37db7323e8efd56d6a698a98abcb8d680b.tar.gz null-browser-12d0ce37db7323e8efd56d6a698a98abcb8d680b.zip | |
Add command+url adapter and switching
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/InputLineSpec.cpp (renamed from spec/CommandInputSpec.cpp) | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/CommandInputSpec.cpp b/spec/InputLineSpec.cpp index e687f70..e4eb9a5 100644 --- a/spec/CommandInputSpec.cpp +++ b/spec/InputLineSpec.cpp @@ -1,15 +1,15 @@ #include "testUtils.h" -#include "widgets/CommandInput.hpp" +#include "widgets/InputLine.hpp" -class CommandInputSpec : public QObject { +class InputLineSpec : public QObject { Q_OBJECT private slots: void testWithInitialInput() { context("when initialized with some text"); it("sets the initial input text") { - CommandInput inputWidget("Initial content", new QWidget()); + InputLine inputWidget("Initial content", new QWidget()); QCOMPARE(inputWidget.getInputCommand(), QString("Initial content")); } @@ -18,7 +18,7 @@ private slots: void testInputUpdate() { context("when user types in input"); it("updates input command") { - CommandInput inputWidget("Initial content", new QWidget()); + InputLine inputWidget("Initial content", new QWidget()); auto input = inputWidget.findChild<QLineEdit *>(); QTest::keyClicks(input, " updated"); @@ -29,7 +29,7 @@ private slots: context("when setInputText is called"); it("sets input command") { - CommandInput inputWidget("Initial content", new QWidget()); + InputLine inputWidget("Initial content", new QWidget()); inputWidget.setInputText("New content"); @@ -40,8 +40,8 @@ private slots: void testSubmitSignalOnReturnKey() { context("when user hits return key"); it("emits the submitted signal with the input command") { - CommandInput inputWidget("Initial content", new QWidget()); - QSignalSpy submitSignal(&inputWidget, &CommandInput::submitted); + InputLine inputWidget("Initial content", new QWidget()); + QSignalSpy submitSignal(&inputWidget, &InputLine::submitted); auto input = inputWidget.findChild<QLineEdit *>(); QTest::keyClicks(input, " updated"); @@ -56,8 +56,8 @@ private slots: void testCancelSignalOnEscapeKey() { context("when user hits escape key"); it("emits 'cancelled' signal") { - CommandInput inputWidget("Initial content", new QWidget()); - QSignalSpy cancelSignal(&inputWidget, &CommandInput::cancelled); + InputLine inputWidget("Initial content", new QWidget()); + QSignalSpy cancelSignal(&inputWidget, &InputLine::cancelled); auto input = inputWidget.findChild<QLineEdit *>(); QTest::keyClick(&inputWidget, Qt::Key_Escape); @@ -67,8 +67,8 @@ private slots: context("when user hits ctrl+l key"); it("emits 'cancelled' signal") { - CommandInput inputWidget("Initial content", new QWidget()); - QSignalSpy cancelSignal(&inputWidget, &CommandInput::cancelled); + InputLine inputWidget("Initial content", new QWidget()); + QSignalSpy cancelSignal(&inputWidget, &InputLine::cancelled); auto input = inputWidget.findChild<QLineEdit *>(); QTest::keyClick(&inputWidget, Qt::Key_L, Qt::ControlModifier); @@ -80,7 +80,7 @@ private slots: void testSetFocus() { context("when setInputFocus is called with true"); xit("focusses input field") { - CommandInput inputWidget("Initial content", new QWidget()); + InputLine inputWidget("Initial content", new QWidget()); inputWidget.setInputFocus(true); QApplication::processEvents(); @@ -90,7 +90,7 @@ private slots: context("when setInputFocus is called with false"); xit("unfocusses input field") { - CommandInput inputWidget("Initial content", new QWidget()); + InputLine inputWidget("Initial content", new QWidget()); inputWidget.setInputFocus(false); QApplication::processEvents(); @@ -100,5 +100,5 @@ private slots: } }; -QTEST_REGISTER(CommandInputSpec) -#include "CommandInputSpec.moc" +QTEST_REGISTER(InputLineSpec) +#include "InputLineSpec.moc" |
