mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-22 00:49:35 -06:00
fix this test
This commit is contained in:
@@ -102,6 +102,7 @@ describe('SavedViewsComponent', () => {
|
|||||||
.get(savedViews[0].id.toString())
|
.get(savedViews[0].id.toString())
|
||||||
.get('show_on_dashboard')
|
.get('show_on_dashboard')
|
||||||
control.setValue(!savedViews[0].show_on_dashboard)
|
control.setValue(!savedViews[0].show_on_dashboard)
|
||||||
|
control.markAsDirty()
|
||||||
|
|
||||||
// saved views error first
|
// saved views error first
|
||||||
savedViewPatchSpy.mockReturnValueOnce(
|
savedViewPatchSpy.mockReturnValueOnce(
|
||||||
@@ -117,6 +118,7 @@ describe('SavedViewsComponent', () => {
|
|||||||
// succeed saved views
|
// succeed saved views
|
||||||
savedViewPatchSpy.mockReturnValueOnce(of(savedViews as SavedView[]))
|
savedViewPatchSpy.mockReturnValueOnce(of(savedViews as SavedView[]))
|
||||||
control.setValue(savedViews[0].show_on_dashboard)
|
control.setValue(savedViews[0].show_on_dashboard)
|
||||||
|
control.markAsDirty()
|
||||||
component.save()
|
component.save()
|
||||||
expect(toastErrorSpy).not.toHaveBeenCalled()
|
expect(toastErrorSpy).not.toHaveBeenCalled()
|
||||||
expect(savedViewPatchSpy).toHaveBeenCalled()
|
expect(savedViewPatchSpy).toHaveBeenCalled()
|
||||||
@@ -133,6 +135,11 @@ describe('SavedViewsComponent', () => {
|
|||||||
.get(view.id.toString())
|
.get(view.id.toString())
|
||||||
.get('show_on_dashboard')
|
.get('show_on_dashboard')
|
||||||
.setValue(!view.show_on_dashboard)
|
.setValue(!view.show_on_dashboard)
|
||||||
|
component.savedViewsForm
|
||||||
|
.get('savedViews')
|
||||||
|
.get(view.id.toString())
|
||||||
|
.get('show_on_dashboard')
|
||||||
|
.markAsDirty()
|
||||||
fixture.detectChanges()
|
fixture.detectChanges()
|
||||||
|
|
||||||
component.save()
|
component.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user