File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,14 +298,21 @@ void TestQgsRelationReferenceWidget::testSetGetForeignKey()
298298 w.setRelation ( *mRelation , true );
299299 w.init ();
300300
301+ QSignalSpy spy ( &w, SIGNAL ( foreignKeyChanged ( QVariant ) ) );
302+
301303 w.setForeignKey ( 11 );
302304 QCOMPARE ( w.foreignKey (), QVariant ( 11 ) );
305+ QCOMPARE ( w.mComboBox ->currentText (), QStringLiteral ( " (11)" ) );
306+ QCOMPARE ( spy.count (), 1 );
303307
304308 w.setForeignKey ( 12 );
305309 QCOMPARE ( w.foreignKey (), QVariant ( 12 ) );
310+ QCOMPARE ( w.mComboBox ->currentText (), QStringLiteral ( " (12)" ) );
311+ QCOMPARE ( spy.count (), 2 );
306312
307313 w.setForeignKey ( QVariant ( QVariant::Int ) );
308314 Q_ASSERT ( w.foreignKey ().isNull () );
315+ QCOMPARE ( spy.count (), 3 );
309316}
310317
311318QGSTEST_MAIN ( TestQgsRelationReferenceWidget )
You can’t perform that action at this time.
0 commit comments