diff --git a/tests/unit-tests/rest-api/test-class-sensei-rest-api-import-controller.php b/tests/unit-tests/rest-api/test-class-sensei-rest-api-import-controller.php index 7f3e2a0d310..e3b768f3adf 100644 --- a/tests/unit-tests/rest-api/test-class-sensei-rest-api-import-controller.php +++ b/tests/unit-tests/rest-api/test-class-sensei-rest-api-import-controller.php @@ -94,7 +94,7 @@ public function testGetImportNotStarted( $user_role, $is_authorized ) { $expected_status_codes = [ 401, 403 ]; if ( $is_authorized ) { - $expected_status_codes = [ 404 ]; + $expected_status_codes = [ 200 ]; } $request = new WP_REST_Request( 'GET', '/sensei-internal/v1/import/active' ); @@ -102,8 +102,8 @@ public function testGetImportNotStarted( $user_role, $is_authorized ) { $this->assertTrue( in_array( $response->get_status(), $expected_status_codes, true ), "{$user_description} requests should produce status of " . implode( ', ', $expected_status_codes ) ); if ( $is_authorized ) { - $this->assertTrue( isset( $response->get_data()['code'] ) ); - $this->assertEquals( 'sensei_data_port_job_not_found', $response->get_data()['code'] ); + $this->assertTrue( isset( $response->get_data()['id'] ) ); + $this->assertEquals( null, $response->get_data()['id'] ); } }