diff --git a/Library/ViewModels/LoadingButtonViewModel.swift b/Library/ViewModels/LoadingButtonViewModel.swift index 26048e2ed4..eb7b60506b 100644 --- a/Library/ViewModels/LoadingButtonViewModel.swift +++ b/Library/ViewModels/LoadingButtonViewModel.swift @@ -23,7 +23,6 @@ public final class LoadingButtonViewModel: public init() { let isLoading = self.isLoadingProperty.signal .skipNil() - .skipRepeats() self.isUserInteractionEnabled = isLoading .negate() diff --git a/Library/ViewModels/LoadingButtonViewModelTests.swift b/Library/ViewModels/LoadingButtonViewModelTests.swift index 9bed7275e6..1a9a143a4a 100644 --- a/Library/ViewModels/LoadingButtonViewModelTests.swift +++ b/Library/ViewModels/LoadingButtonViewModelTests.swift @@ -19,45 +19,15 @@ final class LoadingButtonViewModelTests: TestCase { self.vm.outputs.stopLoading.observe(self.stopLoading.observer) } - func testIsUserInteractionEnabled() { - self.vm.inputs.isLoading(false) - self.isUserInteractionEnabled.assertValues([true]) - - self.vm.inputs.isLoading(false) - self.isUserInteractionEnabled.assertValues([true]) - - self.vm.inputs.isLoading(true) - self.isUserInteractionEnabled.assertValues([true, false]) - - self.vm.inputs.isLoading(true) - self.isUserInteractionEnabled.assertValues([true, false]) - } - - func testStartLoading() { - self.vm.inputs.isLoading(true) - self.startLoading.assertValueCount(1) - + func testIsLoading() { self.vm.inputs.isLoading(true) + self.isUserInteractionEnabled.assertValues([false]) self.startLoading.assertValueCount(1) + self.stopLoading.assertValueCount(0) self.vm.inputs.isLoading(false) + self.isUserInteractionEnabled.assertValues([false, true]) self.startLoading.assertValueCount(1) - - self.vm.inputs.isLoading(true) - self.startLoading.assertValueCount(2) - } - - func testStopLoading() { - self.vm.inputs.isLoading(false) - self.stopLoading.assertValueCount(1) - - self.vm.inputs.isLoading(false) - self.stopLoading.assertValueCount(1) - - self.vm.inputs.isLoading(true) self.stopLoading.assertValueCount(1) - - self.vm.inputs.isLoading(false) - self.stopLoading.assertValueCount(2) } } diff --git a/Library/ViewModels/ProjectPamphletMainCellViewModel.swift b/Library/ViewModels/ProjectPamphletMainCellViewModel.swift index bff8cdb8f3..cbb29e7dbc 100644 --- a/Library/ViewModels/ProjectPamphletMainCellViewModel.swift +++ b/Library/ViewModels/ProjectPamphletMainCellViewModel.swift @@ -324,7 +324,6 @@ public final class ProjectPamphletMainCellViewModel: ProjectPamphletMainCellView .map { project, variant in project.rewards.isEmpty && variant == .variant2 } - .skipRepeats() let shouldTrackCTATappedEvent = projectAndRefTag .takeWhen(self.readMoreButtonTappedProperty.signal) diff --git a/Library/ViewModels/ProjectPamphletMainCellViewModelTests.swift b/Library/ViewModels/ProjectPamphletMainCellViewModelTests.swift index dd9f958167..200c21d75f 100644 --- a/Library/ViewModels/ProjectPamphletMainCellViewModelTests.swift +++ b/Library/ViewModels/ProjectPamphletMainCellViewModelTests.swift @@ -846,7 +846,7 @@ final class ProjectPamphletMainCellViewModelTests: TestCase { self.vm.inputs.configureWith(value: (projectWithRewards, nil, (creatorDetails, false))) - self.readMoreButtonIsLoading.assertValues([true, false]) + self.readMoreButtonIsLoading.assertValues([true, false, false]) } }