Commit db0697e6 authored by Joao Oliveira's avatar Joao Oliveira

Fixed calculate test to be inline with new Document::recalculateForms

parent e8e4cd76
Pipeline #6980 passed with stage
in 14 minutes and 57 seconds
......@@ -75,6 +75,8 @@ void CalculateTextTest::testSimpleCalculate()
QVERIFY( field3 );
m_document->editFormText( 0, field3, QStringLiteral( "30" ), 0, 0, 0 );
m_document->recalculateForms();
// Verify the results
QCOMPARE (fields[QStringLiteral ("Sum")]->text(), QStringLiteral( "60" ));
QCOMPARE (fields[QStringLiteral ("AVG")]->text(), QStringLiteral( "20" ));
......@@ -87,6 +89,7 @@ void CalculateTextTest::testSimpleCalculate()
// Test that multiplication with zero works
m_document->editFormText( 0, field2, QStringLiteral( "0" ), 0, 0, 0 );
m_document->recalculateForms();
QCOMPARE (fields[QStringLiteral ("Prod")]->text(), QStringLiteral( "0" ));
// Test that updating the field also worked with sum
......@@ -95,10 +98,12 @@ void CalculateTextTest::testSimpleCalculate()
// Test that undo / redo works
QVERIFY( m_document->canUndo() );
m_document->undo();
m_document->recalculateForms();
QCOMPARE( fields[QStringLiteral ("Sum")]->text(), QStringLiteral( "60" ) );
QVERIFY( m_document->canRedo() );
m_document->redo();
m_document->recalculateForms();
QCOMPARE( fields[QStringLiteral ("Sum")]->text(), QStringLiteral( "40" ) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment