Angular Plotly test TypeError: Cannot read properties of undefined (reading 'data')
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, plotly, typescript
Direção de pesquisa
Comece executando o spec com falha de GraphComponent em src/app/pages/graph.component.spec.ts e revise a configuração de PlotlyViaWindowModule. Rastreie a chamada createFigure de PlotlyComponent durante ngOnDestroy, usando o stack trace reportado como ponto de entrada. Considera-se concluído quando o teste termina sem o TypeError enquanto o componente continua utilizável com ng serve.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
i am having an issue running the tests file for my page
TypeError: Cannot read properties of undefined (reading 'data')
TypeError: Cannot read properties of undefined (reading 'data')
at PlotlyComponent.createFigure (http://localhost:9876/_karma_webpack_/webpack:/node_modules/angular-plotly.js/__ivy_ngcc__/fesm2015/angular-plotly.js.js:285:21)
at PlotlyComponent.call [as ngOnDestroy] (http://localhost:9876/_karma_webpack_/webpack:/node_modules/angular-plotly.js/__ivy_ngcc__/fesm2015/angular-plotly.js.js:195:29)
at executeOnDestroys (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:6537:32)
at cleanUpView (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:6438:9)
at destroyViewTree (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:6264:21)
at destroyLView (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:6416:9)
at RootViewRef.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:13512:9)
at ComponentRef.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/core.mjs:13958:23)
at ComponentFixture.destroy (http://localhost:9876/_karma_webpack_/webpack:/node_modules/@angular/core/fesm2015/testing.mjs:228:31)
at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/webpack:/src/app/pages/graph.component.spec.ts:163:17)
i am using PlotlyViaWindowModule, when i start ng serve the plot is working correctly without any issues but i cant run the test
describe('GraphComponent', () => {
let component: GraphComponent;
let fixture: ComponentFixture<GraphComponent>;
let debugElement: DebugElement;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [... , PlotlyComponent], providers: [...PlotlyService, { provide: MyPlotService, useClass: myPlotServiceMock},
], imports: [
...
PlotlyViaWindowModule,]
beforeEach(() => {
fixture = TestBed.createComponent(GraphComponent);
component = fixture.componentInstance;
debugElement = fixture.debugElement;
fixture.detectChanges();
});
it('shoud create the app', () => {
expect(component).toBeTruthy();
});
- Linguagem predominante
- TypeScript
- Estrelas
- 242
- Forks
- 81
- Merge médio
- 23h 52min
- PRs com merge (30d)
- 5
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de plotly/angular-plotly.js
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
plotly/angular-plotly.js#373 ·
Mantenedores costumam responder em até 1 dia
-
Feature request: please add migration guideTalvez já em andamento @andrefarzat assumiu há 21 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
plotly/angular-plotly.js#285 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
event handlers are not typedTalvez já em andamento @andrefarzat assumiu há 21 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 38/100
plotly/angular-plotly.js#283 ·
Mantenedores costumam responder em até 1 dia
-
Angular 20 standalone applicationTalvez já em andamento @andrefarzat assumiu há 21 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
plotly/angular-plotly.js#281 · 8 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Angular 19 specs won't runAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
plotly/angular-plotly.js#278 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de plotly/angular-plotly.js
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
riverqueue/river#1576 ·
Mantenedores costumam responder em até 1 dia
-
[bug] A prompt queued during a run is assessed without its textTalvez já em andamento @jwiegley assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
DevMortimer/pi-warden#211 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
mattermost/compass-design#191 ·
Mantenedores costumam responder em até 1 dia
-
Add unit tests for the organization admin role checkTalvez já em andamento @SaffuSafwan assumiu hoje. Abertaarea/core good first issue help wanted
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
elmohq/elmo#1095 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
HorusGoul/trizum#559 · 1 comentário ·
Mantenedores costumam responder em até 1 dia