Angular Plotly test TypeError: Cannot read properties of undefined (reading 'data')
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, plotly, typescript
Hướng nghiên cứu
Bắt đầu bằng cách chạy spec GraphComponent đang bị lỗi trong src/app/pages/graph.component.spec.ts và xem xét thiết lập PlotlyViaWindowModule. Truy vết lệnh gọi createFigure của PlotlyComponent trong ngOnDestroy, sử dụng stack trace được báo cáo làm điểm bắt đầu. Được xem là hoàn tất khi test hoàn thành mà không có TypeError, đồng thời component vẫn có thể sử dụng được với ng serve.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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();
});
- Ngôn ngữ chính
- TypeScript
- Star
- 242
- Fork
- 81
- Merge trung bình
- 23 giờ 52 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/angular-plotly.js
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
plotly/angular-plotly.js#373 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature request: please add migration guideCó thể đã có người làm @andrefarzat đã nhận 21 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
plotly/angular-plotly.js#285 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
event handlers are not typedCó thể đã có người làm @andrefarzat đã nhận 21 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
plotly/angular-plotly.js#283 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Angular 20 standalone applicationCó thể đã có người làm @andrefarzat đã nhận 21 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
plotly/angular-plotly.js#281 · 8 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Angular 19 specs won't runĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
plotly/angular-plotly.js#278 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của plotly/angular-plotly.js
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
riverqueue/river#1576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug] A prompt queued during a run is assessed without its textCó thể đã có người làm @jwiegley đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DevMortimer/pi-warden#211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
mattermost/compass-design#191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add unit tests for the organization admin role checkCó thể đã có người làm @SaffuSafwan đã nhận hôm nay. Đang mởarea/core good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
elmohq/elmo#1095 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
HorusGoul/trizum#559 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày