@@ -386,6 +386,8 @@ final class NewOrderViewModelTests: XCTestCase {
386386 XCTAssertEqual ( paymentDataViewModel. orderTotal, " £30.00 " )
387387 }
388388
389+ // MARK: - Payment Section Tests
390+
389391 func test_payment_section_is_updated_when_products_update( ) {
390392 // Given
391393 let currencySettings = CurrencySettings ( currencyCode: . GBP, currencyPosition: . left, thousandSeparator: " " , decimalSeparator: " . " , numberOfDecimals: 2 )
@@ -656,19 +658,7 @@ final class NewOrderViewModelTests: XCTestCase {
656658
657659 }
658660
659- func test_customer_note_section_is_updated_when_note_is_added_to_order( ) {
660- // Given
661- let storageManager = MockStorageManager ( )
662- let viewModel = NewOrderViewModel ( siteID: sampleSiteID, storageManager: storageManager)
663- let expectedCustomerNote = " Test "
664-
665- //When
666- viewModel. noteViewModel. newNote = expectedCustomerNote
667- viewModel. updateCustomerNote ( )
668-
669- //Then
670- XCTAssertEqual ( viewModel. customerNoteDataViewModel. customerNote, expectedCustomerNote)
671- }
661+ // MARK: - hasChanges Tests
672662
673663 func test_hasChanges_returns_false_initially( ) {
674664 // Given
@@ -761,6 +751,8 @@ final class NewOrderViewModelTests: XCTestCase {
761751 XCTAssertTrue ( viewModel. hasChanges)
762752 }
763753
754+ // MARK: - Tracking Tests
755+
764756 func test_shipping_method_tracked_when_added( ) throws {
765757 // Given
766758 let analytics = MockAnalyticsProvider ( )
@@ -880,6 +872,22 @@ final class NewOrderViewModelTests: XCTestCase {
880872 XCTAssertTrue ( analytics. receivedEvents. isEmpty)
881873 }
882874
875+ // MARK: -
876+
877+ func test_customer_note_section_is_updated_when_note_is_added_to_order( ) {
878+ // Given
879+ let storageManager = MockStorageManager ( )
880+ let viewModel = NewOrderViewModel ( siteID: sampleSiteID, storageManager: storageManager)
881+ let expectedCustomerNote = " Test "
882+
883+ //When
884+ viewModel. noteViewModel. newNote = expectedCustomerNote
885+ viewModel. updateCustomerNote ( )
886+
887+ //Then
888+ XCTAssertEqual ( viewModel. customerNoteDataViewModel. customerNote, expectedCustomerNote)
889+ }
890+
883891 func test_discard_order_deletes_order_if_order_exists_remotely( ) {
884892 // Given
885893 let stores = MockStoresManager ( sessionManager: . testingInstance)
0 commit comments