Changeset View
Changeset View
Standalone View
Standalone View
plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp
Show All 36 Lines | 35 | { | |||
---|---|---|---|---|---|
37 | MessageViewer::_k_eventEditStubModel = model; | 37 | MessageViewer::_k_eventEditStubModel = model; | ||
38 | } | 38 | } | ||
39 | 39 | | |||
40 | ViewerPluginCreateeventTest::~ViewerPluginCreateeventTest() | 40 | ViewerPluginCreateeventTest::~ViewerPluginCreateeventTest() | ||
41 | { | 41 | { | ||
42 | 42 | | |||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | void ViewerPluginCreateeventTest::shouldHaveDefaultValue() | 45 | void ViewerPluginCreateeventTest::shouldCreateAction() | ||
46 | { | 46 | { | ||
47 | MessageViewer::ViewerPluginCreateevent *event = new MessageViewer::ViewerPluginCreateevent(this); | 47 | MessageViewer::ViewerPluginCreateevent *event = new MessageViewer::ViewerPluginCreateevent(this); | ||
48 | QVERIFY(!event->viewerPluginName().isEmpty()); | 48 | QVERIFY(!event->viewerPluginName().isEmpty()); | ||
49 | QWidget *parent = new QWidget(0); | 49 | QWidget *parent = new QWidget(0); | ||
50 | parent->setLayout(new QHBoxLayout); | 50 | parent->setLayout(new QHBoxLayout); | ||
51 | QVERIFY(event->createView(parent, new KActionCollection(this))); | 51 | MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this)); | ||
52 | QVERIFY(interface); | ||||
53 | QVERIFY(!interface->actions().isEmpty()); | ||||
52 | } | 54 | } | ||
53 | 55 | | |||
54 | void ViewerPluginCreateeventTest::shouldCreateAction() | 56 | void ViewerPluginCreateeventTest::shouldShowWidget() | ||
55 | { | 57 | { | ||
56 | MessageViewer::ViewerPluginCreateevent *event = new MessageViewer::ViewerPluginCreateevent(this); | 58 | MessageViewer::ViewerPluginCreateevent *event = new MessageViewer::ViewerPluginCreateevent(this); | ||
57 | QWidget *parent = new QWidget(0); | 59 | QWidget *parent = new QWidget(0); | ||
58 | parent->setLayout(new QHBoxLayout); | 60 | parent->setLayout(new QHBoxLayout); | ||
59 | MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this)); | 61 | MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this)); | ||
60 | QVERIFY(!interface->actions().isEmpty()); | 62 | interface->execute(); | ||
61 | QWidget *createeventwidget = parent->findChild<QWidget *>(QStringLiteral("eventedit")); | 63 | QWidget *createeventwidget = parent->findChild<QWidget *>(QStringLiteral("eventedit")); | ||
62 | QVERIFY(createeventwidget); | 64 | QVERIFY(createeventwidget); | ||
63 | QCOMPARE(createeventwidget->isVisible(), false); | 65 | QCOMPARE(createeventwidget->isHidden(), false); | ||
64 | } | 66 | } | ||
65 | 67 | | |||
66 | QTEST_MAIN(ViewerPluginCreateeventTest) | 68 | QTEST_MAIN(ViewerPluginCreateeventTest) |