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.

Possibility to test directives against running backend (Directive Integration Test) #8835

Closed
@andimarek

Description

@andimarek

Hi,

we would like to have the possibility do test a directive against a running backend.
Our usecase is the following:
A Directive receives JSON data from the backend which should be displayed to the user (e.g. a person).
We would like to test, that the person data binding works as expected: For example the backend sends a person.name and the directive should display the name.

An example pseudo code:

it("name should be shown", function(done){
  var element = createDirective("<person/>");
  notifyWhenNoOutstandingRequests(function(){
    expect(element.find(".name")).to.have.text("test name");
    done():
  }):
});

We don't want to use E2E/Protractor tests, because we are only interested in a single directive (and E2E tests are much slower than Unit-Tests), but we need to communicate with the server (real http requests) to verify the expectations of the directive regarding the data format are met.

Do you understand our intention and find it useful? If so we would happily provide a pull requests to make this kind of test possible. Currently we use a hacky patch of angular-mocks.

Regards,
Andi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions