mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
Remove Angular and Stimulus Reflex from the Settings > Images section
This commit is contained in:
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user