aboutsummaryrefslogtreecommitdiff
path: root/spec/InputLineSpec.cpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-12 20:47:57 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-12 21:06:52 +0530
commit05ae8976a8e1ab5411058de244c4e2fcc87ec369 (patch)
treecb3661ed66b9aeb6b78818228d4ec4785dbf27e1 /spec/InputLineSpec.cpp
parentd46cf6e12452261c6aaf498dddf8e1176d349d6e (diff)
downloadnull-browser-05ae8976a8e1ab5411058de244c4e2fcc87ec369.tar.gz
null-browser-05ae8976a8e1ab5411058de244c4e2fcc87ec369.zip
Refactor MainWindow into InputMediator
Diffstat (limited to 'spec/InputLineSpec.cpp')
-rw-r--r--spec/InputLineSpec.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/InputLineSpec.cpp b/spec/InputLineSpec.cpp
index e4eb9a5..9a3115a 100644
--- a/spec/InputLineSpec.cpp
+++ b/spec/InputLineSpec.cpp
@@ -1,5 +1,4 @@
#include "testUtils.h"
-
#include "widgets/InputLine.hpp"
class InputLineSpec : public QObject {
@@ -11,35 +10,34 @@ private slots:
it("sets the initial input text") {
InputLine inputWidget("Initial content", new QWidget());
- QCOMPARE(inputWidget.getInputCommand(), QString("Initial content"));
+ QCOMPARE(inputWidget.getInputText(), QString("Initial content"));
}
}
void testInputUpdate() {
context("when user types in input");
- it("updates input command") {
+ it("updates input text") {
InputLine inputWidget("Initial content", new QWidget());
auto input = inputWidget.findChild<QLineEdit *>();
QTest::keyClicks(input, " updated");
- QCOMPARE(inputWidget.getInputCommand(),
- QString("Initial content updated"));
+ QCOMPARE(inputWidget.getInputText(), QString("Initial content updated"));
}
context("when setInputText is called");
- it("sets input command") {
+ it("sets input text") {
InputLine inputWidget("Initial content", new QWidget());
inputWidget.setInputText("New content");
- QCOMPARE(inputWidget.getInputCommand(), QString("New content"));
+ QCOMPARE(inputWidget.getInputText(), QString("New content"));
}
}
void testSubmitSignalOnReturnKey() {
context("when user hits return key");
- it("emits the submitted signal with the input command") {
+ it("emits the submitted signal with the input text") {
InputLine inputWidget("Initial content", new QWidget());
QSignalSpy submitSignal(&inputWidget, &InputLine::submitted);