Skip to content

Commit 19b338c

Browse files
feat(#2609): add data-grid component
1 parent 4c9aeaa commit 19b338c

File tree

105 files changed

+3514
-671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3514
-671
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { ComponentFixture, TestBed } from "@angular/core/testing";
2+
import { GoabDataGrid } from "./data-grid";
3+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
4+
import { By } from "@angular/platform-browser";
5+
6+
@Component({
7+
template: `
8+
<goab-data-grid>
9+
<div>Test content</div>
10+
</goab-data-grid>
11+
`
12+
})
13+
class TestDataGridComponent {}
14+
15+
describe("GoabDataGrid", () => {
16+
let fixture: ComponentFixture<TestDataGridComponent>;
17+
let component: TestDataGridComponent;
18+
19+
beforeEach(async () => {
20+
await TestBed.configureTestingModule({
21+
imports: [GoabDataGrid],
22+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
23+
declarations: [TestDataGridComponent]
24+
}).compileComponents();
25+
26+
fixture = TestBed.createComponent(TestDataGridComponent);
27+
component = fixture.componentInstance;
28+
fixture.detectChanges();
29+
});
30+
31+
it("should create component and render goa-data-grid with projected content", () => {
32+
expect(component).toBeTruthy();
33+
34+
const dataGridElement = fixture.debugElement.query(By.css("goa-data-grid")).nativeElement;
35+
expect(dataGridElement).toBeTruthy();
36+
expect(dataGridElement.textContent).toContain("Test content");
37+
});
38+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from "@angular/core";
2+
3+
@Component({
4+
standalone: true,
5+
selector: "goab-data-grid",
6+
template: `
7+
<goa-data-grid>
8+
<ng-content></ng-content>
9+
</goa-data-grid>
10+
`,
11+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
12+
})
13+
export class GoabDataGrid {}

libs/angular-components/src/lib/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export * from "./chip/chip";
1414
export * from "./circular-progress/circular-progress";
1515
export * from "./column-layout/column-layout";
1616
export * from "./container/container";
17+
export * from "./data-grid/data-grid";
1718
export * from "./date-picker/date-picker";
1819
export * from "./details/details";
1920
export * from "./divider/divider";

0 commit comments

Comments
 (0)