File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -298,14 +298,21 @@ void TestQgsRelationReferenceWidget::testSetGetForeignKey()
298
298
w.setRelation ( *mRelation , true );
299
299
w.init ();
300
300
301
+ QSignalSpy spy ( &w, SIGNAL ( foreignKeyChanged ( QVariant ) ) );
302
+
301
303
w.setForeignKey ( 11 );
302
304
QCOMPARE ( w.foreignKey (), QVariant ( 11 ) );
305
+ QCOMPARE ( w.mComboBox ->currentText (), QStringLiteral ( " (11)" ) );
306
+ QCOMPARE ( spy.count (), 1 );
303
307
304
308
w.setForeignKey ( 12 );
305
309
QCOMPARE ( w.foreignKey (), QVariant ( 12 ) );
310
+ QCOMPARE ( w.mComboBox ->currentText (), QStringLiteral ( " (12)" ) );
311
+ QCOMPARE ( spy.count (), 2 );
306
312
307
313
w.setForeignKey ( QVariant ( QVariant::Int ) );
308
314
Q_ASSERT ( w.foreignKey ().isNull () );
315
+ QCOMPARE ( spy.count (), 3 );
309
316
}
310
317
311
318
QGSTEST_MAIN ( TestQgsRelationReferenceWidget )
You can’t perform that action at this time.
0 commit comments