Cypress component test: No provider for transloco? #615
Unanswered
mikasjoman
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
``Hi
I am trying to get component tests in Cypress 11.2 working with an Angular 14 project.
So I have a class that in its constructor takes a TranslocoService and then in the html uses the pipe {{ 'json.file.strIdentifier' | transloco }}
But I am getting "No provider for transloco!" NullinjectorError
Does anyone know how to inject transloco so the pipe works in Cypress component tests?
I tried creating a MockPipe class that just returns the string and the component class to accept either a TranslocoService or my own TranslocoMockPipe class I created but it still failes the same. Does anyone have a clue how to get Cypress to accept the injected Translocoservice as a pipe?
In my cypress test file I have the following (Adding as a comment below since this github editor fails to copy it in as code).
Beta Was this translation helpful? Give feedback.
All reactions