Remove Angular and Stimulus Reflex from the Settings > Images section

This commit is contained in:
Cillian O'Ruanaidh
2025-04-18 11:49:53 +01:00
parent a8b5a79b4b
commit a9a4156251
17 changed files with 140 additions and 264 deletions

View File

@@ -25,72 +25,6 @@ describe "enterpriseCtrl", ->
it "stores enterprise", ->
expect(scope.Enterprise).toEqual enterprise
describe "removing logo", ->
deferred = null
beforeEach inject ($q) ->
spyOn(scope, "$emit")
deferred = $q.defer()
spyOn(window, "confirm").and.returnValue(true)
spyOn(Enterprises, "removeLogo").and.returnValue(deferred.promise)
spyOn(StatusMessage, "display").and.callThrough()
scope.removeLogo()
describe "when successful", ->
beforeEach inject ($rootScope) ->
deferred.resolve()
$rootScope.$digest()
it "emits an 'enterprise:updated' event", ->
expect(scope.$emit).toHaveBeenCalledWith("enterprise:updated", scope.Enterprise)
it "notifies user of success", ->
expect(StatusMessage.display).toHaveBeenCalledWith("success", "Logo removed successfully")
describe "when unsuccessful", ->
beforeEach inject ($rootScope) ->
deferred.reject({ data: { error: "Logo does not exist" } })
$rootScope.$digest()
it "does not emit an 'enterprise:updated' event", ->
expect(scope.$emit).not.toHaveBeenCalled()
it "notifies user of failure", ->
expect(StatusMessage.display).toHaveBeenCalledWith("failure", "Logo does not exist")
describe "removing promo image", ->
deferred = null
beforeEach inject ($q) ->
spyOn(scope, "$emit")
deferred = $q.defer()
spyOn(window, "confirm").and.returnValue(true)
spyOn(Enterprises, "removePromoImage").and.returnValue(deferred.promise)
spyOn(StatusMessage, "display").and.callThrough()
scope.removePromoImage()
describe "when successful", ->
beforeEach inject ($rootScope) ->
deferred.resolve()
$rootScope.$digest()
it "emits an 'enterprise:updated' event", ->
expect(scope.$emit).toHaveBeenCalledWith("enterprise:updated", scope.Enterprise)
it "notifies user of success", ->
expect(StatusMessage.display).toHaveBeenCalledWith("success", "Promo image removed successfully")
describe "when unsuccessful", ->
beforeEach inject ($rootScope) ->
deferred.reject({ data: { error: "Promo image does not exist" } })
$rootScope.$digest()
it "does not emit an 'enterprise:updated' event", ->
expect(scope.$emit).not.toHaveBeenCalled()
it "notifies user of failure", ->
expect(StatusMessage.display).toHaveBeenCalledWith("failure", "Promo image does not exist")
describe "adding managers", ->
u1 = u2 = u3 = null
beforeEach ->