Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Angular mocks no longer mocking browser cookies #12692

Open
@butchpeters

Description

@butchpeters

We have recently migrated to angular 1.4, and we noticed some tests are intermittently failing due to state that is being leftover between tests in the cookies. It appears the the mocking of cookies was removed from angular-mocks in the latest versions. I have a couple of plunks to illustrate the point.

Here, in angular 1.3, the cookie is set in $cookieStore in one test, and it is not defined in $cookieStore in subsequent tests:
http://plnkr.co/edit/WbRKACxBvJkHUmJwntN4?p=preview

In angular 1.4, however, the cookie is still set on subsequent tests, causing it to fail:
http://plnkr.co/edit/c6jpOmmSuufSYvQysdTQ?p=preview

Was this functionality intentionally removed, and if so can you let me know what the intended workaround is?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions