diff --git a/controller/state_test.go b/controller/state_test.go index 58cfe5c596ebc..41c00ae1afb47 100644 --- a/controller/state_test.go +++ b/controller/state_test.go @@ -1710,3 +1710,26 @@ func TestUseDiffCache(t *testing.T) { }) } } + +func TestCompareAppStateDefaultRevisionUpdated(t *testing.T) { + app := newFakeApp() + data := fakeData{ + manifestResponse: &apiclient.ManifestResponse{ + Manifests: []string{}, + Namespace: test.FakeDestNamespace, + Server: test.FakeClusterURL, + Revision: "abc123", + }, + managedLiveObjs: make(map[kube.ResourceKey]*unstructured.Unstructured), + } + ctrl := newFakeController(&data, nil) + sources := make([]argoappv1.ApplicationSource, 0) + sources = append(sources, app.Spec.GetSource()) + revisions := make([]string, 0) + revisions = append(revisions, "") + compRes, err := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, sources, false, false, nil, false, false) + require.NoError(t, err) + assert.NotNil(t, compRes) + assert.NotNil(t, compRes.syncStatus) + assert.True(t, compRes.revisionUpdated) +} \ No newline at end of file