Skip to content

Commit 1d4b701

Browse files
committed
Update tests from products_m5 to products_variations feedback type
1 parent f6b6fce commit 1d4b701

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

WooCommerce/WooCommerceTests/ViewRelated/Products/ProductsTopBannerFactoryTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class ProductsTopBannerFactoryTests: XCTestCase {
2828

2929
func test_it_tracks_featureFeedbackBanner_gaveFeedback_event_when_giveFeedback_button_is_pressed() throws {
3030
// Given
31-
let bannerMirror = try makeBannerViewMirror(for: .productsM4)
31+
let bannerMirror = try makeBannerViewMirror(for: .variations)
3232
let giveFeedbackButton = try XCTUnwrap(bannerMirror.actionButtons.first)
3333

3434
assertEmpty(analyticsProvider.receivedEvents)
@@ -41,7 +41,7 @@ final class ProductsTopBannerFactoryTests: XCTestCase {
4141
XCTAssertEqual(analyticsProvider.receivedEvents.first, "feature_feedback_banner")
4242

4343
let properties = try XCTUnwrap(analyticsProvider.receivedProperties.first)
44-
XCTAssertEqual(properties["context"] as? String, "products_m4")
44+
XCTAssertEqual(properties["context"] as? String, "products_variations")
4545
XCTAssertEqual(properties["action"] as? String, "gave_feedback")
4646
}
4747

WooCommerce/WooCommerceTests/ViewRelated/Survey/SurveyViewControllerTests.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ final class SurveyViewControllerTests: XCTestCase {
2424

2525
func test_it_loads_the_correct_product_feedback_survey() throws {
2626
// Given
27-
let viewController = SurveyViewController(survey: .productsM5Feedback, onCompletion: {})
27+
let viewController = SurveyViewController(survey: .productsVariationsFeedback, onCompletion: {})
2828

2929
// When
3030
_ = try XCTUnwrap(viewController.view)
3131
let mirror = try self.mirror(of: viewController)
3232

3333
// Then
3434
XCTAssertTrue(mirror.webView.isLoading)
35-
XCTAssertEqual(mirror.webView.url, WooConstants.URLs.productsM4Feedback
35+
XCTAssertEqual(mirror.webView.url, WooConstants.URLs.productsFeedback
3636
.asURL().tagPlatform("ios")
37-
.tagProductMilestone("5")
3837
.tagAppVersion(Bundle.main.bundleVersion()))
3938
}
4039

Yosemite/YosemiteTests/Stores/AppSettings/InAppFeedbackCardVisibilityUseCaseTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ final class InAppFeedbackCardVisibilityUseCaseTests: XCTestCase {
158158
func test_shouldBeVisible_for_productM5_is_true_if_no_settings_are_found() throws {
159159
// Given
160160
let settings = GeneralAppSettings(installationDate: nil, feedbacks: [:])
161-
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsM5)
161+
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsVariations)
162162

163163
// When
164164
let shouldBeVisible = try useCase.shouldBeVisible()
@@ -169,8 +169,8 @@ final class InAppFeedbackCardVisibilityUseCaseTests: XCTestCase {
169169

170170
func test_shouldBeVisible_for_productM5_is_true_if_feedback_has_pending_status() throws {
171171
// Given
172-
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsM5, feedbackSatus: .pending)
173-
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsM5)
172+
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsVariations, feedbackSatus: .pending)
173+
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsVariations)
174174

175175
// When
176176
let shouldBeVisible = try useCase.shouldBeVisible()
@@ -181,8 +181,8 @@ final class InAppFeedbackCardVisibilityUseCaseTests: XCTestCase {
181181

182182
func test_shouldBeVisible_for_productM5_is_false_if_feedback_has_dismissed_status() throws {
183183
// Given
184-
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsM5, feedbackSatus: .dismissed)
185-
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsM5)
184+
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsVariations, feedbackSatus: .dismissed)
185+
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsVariations)
186186

187187
// When
188188
let shouldBeVisible = try useCase.shouldBeVisible()
@@ -193,8 +193,8 @@ final class InAppFeedbackCardVisibilityUseCaseTests: XCTestCase {
193193

194194
func test_shouldBeVisible_for_productM5_is_false_if_feedback_has_given_status() throws {
195195
// Given
196-
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsM5, feedbackSatus: .given(Date()))
197-
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsM5)
196+
let settings = createAppSetting(instalationDate: nil, feedbackType: .productsVariations, feedbackSatus: .given(Date()))
197+
let useCase = InAppFeedbackCardVisibilityUseCase(settings: settings, feedbackType: .productsVariations)
198198

199199
// When
200200
let shouldBeVisible = try useCase.shouldBeVisible()

Yosemite/YosemiteTests/Stores/AppSettingsStoreTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,12 @@ final class AppSettingsStoreTests: XCTestCase {
355355
func test_loadFeedbackVisibility_for_productsM5_returns_true_after_marking_it_as_pending() throws {
356356
// Given
357357
try fileStorage?.deleteFile(at: expectedGeneralAppSettingsFileURL)
358-
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsM5, status: .pending) { _ in }
358+
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsVariations, status: .pending) { _ in }
359359
subject?.onAction(updateAction)
360360

361361
// When
362362
var visibilityResult: Result<Bool, Error>?
363-
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsM5) { result in
363+
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsVariations) { result in
364364
visibilityResult = result
365365
}
366366
subject?.onAction(queryAction)
@@ -375,12 +375,12 @@ final class AppSettingsStoreTests: XCTestCase {
375375
func test_loadFeedbackVisibility_for_productsM5_returns_false_after_marking_it_as_dismissed() throws {
376376
// Given
377377
try fileStorage?.deleteFile(at: expectedGeneralAppSettingsFileURL)
378-
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsM5, status: .dismissed) { _ in }
378+
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsVariations, status: .dismissed) { _ in }
379379
subject?.onAction(updateAction)
380380

381381
// When
382382
var visibilityResult: Result<Bool, Error>?
383-
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsM5) { result in
383+
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsVariations) { result in
384384
visibilityResult = result
385385
}
386386
subject?.onAction(queryAction)
@@ -395,12 +395,12 @@ final class AppSettingsStoreTests: XCTestCase {
395395
func test_loadFeedbackVisibility_for_productsM5_returns_false_after_marking_it_as_given() throws {
396396
// Given
397397
try fileStorage?.deleteFile(at: expectedGeneralAppSettingsFileURL)
398-
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsM5, status: .given(Date())) { _ in }
398+
let updateAction = AppSettingsAction.updateFeedbackStatus(type: .productsVariations, status: .given(Date())) { _ in }
399399
subject?.onAction(updateAction)
400400

401401
// When
402402
var visibilityResult: Result<Bool, Error>?
403-
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsM5) { result in
403+
let queryAction = AppSettingsAction.loadFeedbackVisibility(type: .productsVariations) { result in
404404
visibilityResult = result
405405
}
406406
subject?.onAction(queryAction)

0 commit comments

Comments
 (0)