@@ -61,9 +61,8 @@ final class ConfigurationManagerTests: XCTestCase {
6161 // GIVEN
6262 mockFetcher. shouldFailPrivacyFetch = true
6363 operationLog. steps = [ ]
64- let expectedOrder : [ ConfigurationStep ] = [
65- . fetchPrivacyConfigStarted,
66- . fetchSurrogatesStarted,
64+ let expectedFirstTwoSteps : Set < ConfigurationStep > = [ . fetchPrivacyConfigStarted, . fetchSurrogatesStarted]
65+ let expectedRemainingStepsOrder : [ ConfigurationStep ] = [
6766 . fetchTrackerDataSetStarted,
6867 . reloadPrivacyConfig,
6968 . reloadTrackerDataSet
@@ -73,15 +72,15 @@ final class ConfigurationManagerTests: XCTestCase {
7372 await configManager. fetchAndUpdateTrackerBlockingDependencies ( )
7473
7574 // THEN
76- XCTAssertEqual ( operationLog. steps, expectedOrder, " Operations did not occur in the expected order. " )
75+ XCTAssertEqual ( Set ( operationLog. steps. prefix ( 2 ) ) , expectedFirstTwoSteps, " Steps do not match the expected order. " )
76+ XCTAssertEqual ( Array ( operationLog. steps. dropFirst ( 2 ) ) , expectedRemainingStepsOrder, " Steps do not match the expected order. " )
7777 }
7878
7979 func test_WhenRefreshNow_ThenPrivacyConfigFetchAndReloadBeforeTrackerDataSetFetch( ) async {
8080 // GIVEN
8181 operationLog. steps = [ ]
82- let expectedOrder : [ ConfigurationStep ] = [
83- . fetchPrivacyConfigStarted,
84- . fetchSurrogatesStarted,
82+ let expectedFirstTwoSteps : Set < ConfigurationStep > = [ . fetchPrivacyConfigStarted, . fetchSurrogatesStarted]
83+ let expectedRemainingStepsOrder : [ ConfigurationStep ] = [
8584 . reloadPrivacyConfig,
8685 . fetchTrackerDataSetStarted,
8786 . reloadPrivacyConfig,
@@ -92,7 +91,8 @@ final class ConfigurationManagerTests: XCTestCase {
9291 await configManager. fetchAndUpdateTrackerBlockingDependencies ( )
9392
9493 // THEN
95- XCTAssertEqual ( operationLog. steps, expectedOrder, " Operations did not occur in the expected order. " )
94+ XCTAssertEqual ( Set ( operationLog. steps. prefix ( 2 ) ) , expectedFirstTwoSteps, " Steps do not match the expected order. " )
95+ XCTAssertEqual ( Array ( operationLog. steps. dropFirst ( 2 ) ) , expectedRemainingStepsOrder, " Steps do not match the expected order. " )
9696 }
9797
9898}
0 commit comments