type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
error => {
store.commit(SHOW_LOADING, false, { root: true });
return error;
} | spartan73rmy/FitoReportWeb | fitoreportweb/src/main.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [ArtemisExerciseScoresChartModule, ArtemisSharedModule, FontAwesomeModule, RouterModule.forChild(routes), NgxChartsModule],
declarations: [CourseStatisticsComponent],
})
export class CourseStatisticsModule {} | ls1intum/ArTEMiS | src/main/webapp/app/overview/course-statistics/course-statistics.module.ts | TypeScript |
EnumDeclaration |
export enum OrderState {
NEW = 'NEW',
APPROVED = 'APPROVED',
REJECTED = 'REJECTED',
} | Ashniu123/nestjs-customer-order-eventsourcing-cqrs | libs/order-common/src/order-state.enum.ts | TypeScript |
FunctionDeclaration |
function getPageName(id: PageDefinition['id']): string {
// NOTE: assumes the page is always found
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const page = filteredPagesMap[id];
if (page.isDrillDown) {
// NOTE: assumes the drilldown page always have ... | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
({
allowDrillDownPages = false,
name,
onChange = noop,
value
}) => {
const filteredPagesMap = useSelector((state: ReduxState) => {
const pagesMap = createPagesMap(state.pages);
return allowDrillDownPages ? pagesMap : pickBy(pagesMap, page => !page.isDrillDown);
});
const [pa... | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
(state: ReduxState) => {
const pagesMap = createPagesMap(state.pages);
return allowDrillDownPages ? pagesMap : pickBy(pagesMap, page => !page.isDrillDown);
} | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
page => !page.isDrillDown | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
(event, field) => {
const fieldValue = field.value as string;
setPageId(fieldValue);
onChange(event, { name, value: fieldValue });
} | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
page => ({
text: getPageName(page.id),
value: page.id,
key: page.id
}) | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
(a, b) => a.text.localeCompare(b.text) | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
TypeAliasDeclaration |
type PageFilterProps = Pick<Stage.Types.CustomConfigurationComponentProps<string>, 'name' | 'onChange' | 'value'> & {
allowDrillDownPages?: boolean;
}; | cloudify-cosmo/cloudify-stage | app/components/shared/PageFilter.tsx | TypeScript |
ArrowFunction |
(loadPeristedState = true) => {
const autoSaved = getAutoSavedOperatorData();
const initialState: EditorReducerState = {
operator: getDefaultOperator(),
operatorModified: false,
uploads: [],
formErrors: {},
sectionStatus: {
metadata: EDITOR_STATUS.empty,
'owned-crds': EDITOR_STA... | AlexRogalskiy/operatorhub.io | frontend/src/redux/editorReducer.ts | TypeScript |
ArrowFunction |
(state: EditorReducerState = getInitialState(), action) => {
switch (action.type) {
case reduxConstants.SET_EDITOR_SECTION_STATUS:
return {
...state,
sectionStatus: {
...state.sectionStatus,
[action.section]: action.status
}
};
case reduxConstants.SET_... | AlexRogalskiy/operatorhub.io | frontend/src/redux/editorReducer.ts | TypeScript |
InterfaceDeclaration |
export interface EditorReducerState {
operator: Operator
operatorModified: boolean
uploads: UploadMetadata[],
formErrors: any,
sectionStatus: Record<keyof ISectionFields, EDITOR_STATUS>
} | AlexRogalskiy/operatorhub.io | frontend/src/redux/editorReducer.ts | TypeScript |
ArrowFunction |
async (resolve: (result: string) => void, reject) => {
const filter = input.value.substring(0, input.selectionStart);
const history = getHistorySuggestions(filter);
const historySuggestions: Suggestion[] = [];
if ((!history[0] || !history[0].canSuggest) && filter.trim() !== '') {
hist... | Azamat1993/wexond | src/renderer/app/store/suggestions.ts | TypeScript |
ClassDeclaration |
export class SuggestionsStore {
@observable
public suggestions: Suggestion[] = [];
@observable
public selected = 0;
public load(input: HTMLInputElement) {
return new Promise(async (resolve: (result: string) => void, reject) => {
const filter = input.value.substring(0, input.selectionStart);
... | Azamat1993/wexond | src/renderer/app/store/suggestions.ts | TypeScript |
MethodDeclaration |
public load(input: HTMLInputElement) {
return new Promise(async (resolve: (result: string) => void, reject) => {
const filter = input.value.substring(0, input.selectionStart);
const history = getHistorySuggestions(filter);
const historySuggestions: Suggestion[] = [];
if ((!history[0] || !... | Azamat1993/wexond | src/renderer/app/store/suggestions.ts | TypeScript |
FunctionDeclaration |
function createComponent<T>(
componentType: Type<T>, declarations: any[] = []): ComponentFixture<T> {
TestBed.configureTestingModule({
imports: [CdkTableModule, BidiModule],
declarations: [componentType, ...declarations],
}).compileComponents();
return TestBed.createComponent<T>(componen... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function setupTableTestApp(componentType: Type<any>, declarations: any[] = []) {
fixture = createComponent(componentType, declarations);
component = fixture.componentInstance;
fixture.detectChanges();
tableElement = fixture.nativeElement.querySelector('.cdk-table');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function addInitialIndexAttribute() {
// Each row receives an attribute 'initialIndex' the element's original place
getRows(tableElement).forEach((row: Element, index: number) => {
row.setAttribute('initialIndex', index.toString());
});
// Prove that the attributes match thei... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function expectNoStickyStyles(elements: any[]) {
elements.forEach(element => {
expect(element.classList.contains('cdk-table-sticky')).toBe(false);
expectStickyBorderClass(element);
expect(element.style.position).toBe('');
expect(element.style.zIndex || '0').toBe('0');
['to... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function expectStickyStyles(element: any, zIndex: string, directions: PositionDirections = {}) {
expect(element.style.position).toContain('sticky');
expect(element.style.zIndex)
.withContext(`Expected zIndex to be ${zIndex}`).toBe(zIndex);
['top', 'bottom', 'left', 'right'].forEach(d => {
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function expectStickyBorderClass(element: any, directions: {[key: string]: boolean} = {}) {
['top', 'bottom', 'left', 'right'].forEach(d => {
const stickyClass = `cdk-table-sticky-border-elem-${d}`;
if (directions[d]) {
expect(element.classList).toContain(stickyClass);
} else {... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function createTestComponentWithTrackyByTable(trackByStrategy: string) {
fixture = createComponent(TrackByCdkTableApp);
component = fixture.componentInstance;
component.trackByStrategy = trackByStrategy;
tableElement = fixture.nativeElement.querySelector('cdk-table');
fixture.detectChan... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration | // Swap first two elements, remove the third, add new data
function mutateData() {
// Swap first and second data in data array
const copiedData = component.dataSource.data.slice();
const temp = copiedData[0];
copiedData[0] = copiedData[1];
copiedData[1] = temp;
// Remove the third e... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getElements(element: Element, query: string): HTMLElement[] {
return [].slice.call(element.querySelectorAll(query));
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getHeaderRows(tableElement: Element): HTMLElement[] {
return [].slice.call(tableElement.querySelectorAll('.cdk-header-row'))!;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getFooterRows(tableElement: Element): HTMLElement[] {
return [].slice.call(tableElement.querySelectorAll('.cdk-footer-row'))!;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getRows(tableElement: Element): HTMLElement[] {
return getElements(tableElement, '.cdk-row');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getCells(row: Element): HTMLElement[] {
if (!row) {
return [];
}
let cells = getElements(row, 'cdk-cell');
if (!cells.length) {
cells = getElements(row, 'td.cdk-cell');
}
return cells;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getHeaderCells(headerRow: Element): HTMLElement[] {
let cells = getElements(headerRow, 'cdk-header-cell');
if (!cells.length) {
cells = getElements(headerRow, 'th.cdk-header-cell');
}
return cells;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getFooterCells(footerRow: Element): HTMLElement[] {
let cells = getElements(footerRow, 'cdk-footer-cell');
if (!cells.length) {
cells = getElements(footerRow, 'td.cdk-footer-cell');
}
return cells;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function getActualTableContent(tableElement: Element): string[][] {
let actualTableContent: Element[][] = [];
getHeaderRows(tableElement).forEach(row => {
actualTableContent.push(getHeaderCells(row));
});
// Check data row cells
const rows = getRows(tableElement).map(row => getCells(row));
actualTable... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
export function expectTableToMatchContent(tableElement: Element, expected: any[]) {
const missedExpectations: string[] = [];
function checkCellContent(actualCell: string, expectedCell: string) {
if (actualCell !== expectedCell) {
missedExpectations.push(`Expected cell contents to be ${expectedCell} but w... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
FunctionDeclaration |
function checkCellContent(actualCell: string, expectedCell: string) {
if (actualCell !== expectedCell) {
missedExpectations.push(`Expected cell contents to be ${expectedCell} but was ${actualCell}`);
}
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(SimpleCdkTableApp);
component = fixture.componentInstance as SimpleCdkTableApp;
dataSource = component.dataSource;
table = component.table;
fixture.detectChanges();
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
it('with a connected data source', () => {
expect(table.dataSource).toBe(dataSource);
expect(dataSource.isConnected).toBe(true);
expect(component.contentChangedCount).toBe(1);
});
it('with a rendered header with the right number of header cells', () => {
const... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(table.dataSource).toBe(dataSource);
expect(dataSource.isConnected).toBe(true);
expect(component.contentChangedCount).toBe(1);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const header = getHeaderRows(tableElement)[0];
expect(header).toBeTruthy();
expect(header.classList).toContain('customHeaderRowClass');
expect(getHeaderCells(header).length).toBe(component.columnsToRender.length);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const rows = getRows(tableElement);
expect(rows.length).toBe(dataSource.data.length);
rows.forEach(row => {
expect(row.classList).toContain('customRowClass');
expect(getCells(row).length).toBe(component.columnsToRender.length);
});
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
expect(row.classList).toContain('customRowClass');
expect(getCells(row).length).toBe(component.columnsToRender.length);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const header = getHeaderRows(tableElement)[0];
getHeaderCells(header).forEach((headerCell, index) => {
expect(headerCell.classList).toContain(`cdk-column-${component.columnsToRender[index]}`);
});
getRows(tableElement).forEach(row => {
getCells(row).forEach(... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
(headerCell, index) => {
expect(headerCell.classList).toContain(`cdk-column-${component.columnsToRender[index]}`);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
getCells(row).forEach((cell, index) => {
expect(cell.classList).toContain(`cdk-column-${component.columnsToRender[index]}`);
});
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
(cell, index) => {
expect(cell.classList).toContain(`cdk-column-${component.columnsToRender[index]}`);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(tableElement.getAttribute('role')).toBe('table');
expect(getHeaderRows(tableElement)[0].getAttribute('role')).toBe('row');
const header = getHeaderRows(tableElement)[0];
getHeaderCells(header).forEach(cell => {
expect(cell.getAttribute('role')).toBe('columnhead... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
cell => {
expect(cell.getAttribute('role')).toBe('columnheader');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
expect(row.getAttribute('role')).toBe('row');
getCells(row).forEach(cell => {
expect(cell.getAttribute('role')).toBe('cell');
});
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
cell => {
expect(cell.getAttribute('role')).toBe('cell');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(dataSource.isConnected).toBe(true);
fixture.destroy();
expect(dataSource.isConnected).toBe(false);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
dataSource.addData();
fixture.detectChanges();
// Expect it to have emitted once on init, and once again for the data changes.
expect(component.contentChangedCount).toBe(2);
expect(getRows(tableElement).length).toBe(dataSource.data.length);
// Check that the number of cel... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
expect(getCells(row).length).toBe(component.columnsToRender.length);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
// Note: we cast the assertions here to booleans, because they may
// contain circular objects which will throw Jasmine into an infinite
// when its tries to stringify them to show a test failure.
expect(!!CdkCellOutlet.mostRecentCellOutlet).toBe(true);
fixture.destroy();
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
function addInitialIndexAttribute() {
// Each row receives an attribute 'initialIndex' the element's original place
getRows(tableElement).forEach((row: Element, index: number) => {
row.setAttribute('initialIndex', index.toString());
});
// Prove that the attribu... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
(row: Element, index: number) => {
row.setAttribute('initialIndex', index.toString());
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
addInitialIndexAttribute();
// Swap first and second data in data array
const copiedData = component.dataSource!.data.slice();
const temp = copiedData[0];
copiedData[0] = copiedData[1];
copiedData[1] = temp;
// Remove the third element
copiedDat... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const obj = {value: true};
component.dataSource!.data = [obj, obj, obj];
addInitialIndexAttribute();
const copiedData = component.dataSource!.data.slice();
// Remove the third element and add a new different obj in the beginning.
copiedData.splice(2, 1);
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
if (row.getAttribute('initialIndex') !== null) {
numInitialRows++;
}
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const rowOutlet = fixture.componentInstance.table._rowOutlet.viewContainer;
const headerPlaceholder = fixture.componentInstance.table._headerRowOutlet.viewContainer;
spyOn(rowOutlet, 'clear').and.callThrough();
spyOn(headerPlaceholder, 'clear').and.callThrough();
fixture.destroy... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const initialDataLength = dataSource.data.length;
expect(dataSource.data.length).toBe(3);
let data = dataSource.data;
expectTableToMatchContent(tableElement, [
['Column A', 'Column B', 'Column C'],
[data[0].a, data[0].b, data[0].c],
[data[1].a, data[1].b, data[1... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(dataSource.data.length).toBe(3);
let data = dataSource.data;
expectTableToMatchContent(tableElement, [
['Column A', 'Column B', 'Column C'],
[data[0].a, data[0].b, data[0].c],
[data[1].a, data[1].b, data[1].c],
[data[2].a, data[2].b, data[2].c],
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
rowData => changedTableContent.push([rowData.c, rowData.b]) | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(tableElement.textContent!.trim()).not.toContain('No data');
const originalData = dataSource.data;
dataSource.data = [];
fixture.detectChanges();
expect(tableElement.textContent!.trim()).toContain('No data');
dataSource.data = originalData;
fixture.detectChang... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.destroy();
fixture = TestBed.createComponent(SimpleCdkTableApp);
fixture.componentInstance.dataSource.data = [];
fixture.detectChanges();
tableElement = fixture.nativeElement.querySelector('.cdk-table');
expect(tableElement.textContent!.trim()).toContain('No data');
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(NullDataCdkTableApp);
fixture.detectChanges();
expect(getRows(tableElement).length).toBe(0);
// Emits that the data rows are changed even when the result is empty.
expect(component.contentChangedCount).toBe(1);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(MultipleHeaderFooterRowsCdkTableApp);
fixture.detectChanges();
expectTableToMatchContent(tableElement, [
['first-header'],
['second-header'],
['first-footer'],
['second-footer'],
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(NativeHtmlTableWithCaptionApp);
fixture.detectChanges();
const caption = tableElement.querySelector('caption');
expect(caption).toBeTruthy();
expect(tableElement.firstElementChild).toBe(caption);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(NativeHtmlTableWithColgroupAndCol);
fixture.detectChanges();
const colgroupsAndCols = Array.from(tableElement.querySelectorAll('colgroup, col'));
expect(colgroupsAndCols.length).toBe(3);
expect(colgroupsAndCols[0].childNodes[0]).toBe(colgroupsAndCols[1]);
expect(colg... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
e => e.nodeName.toLowerCase() | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
let baseData: TestData[] = [
{a: 'a_1', b: 'b_1', c: 'c_1'},
{a: 'a_2', b: 'b_2', c: 'c_2'},
{a: 'a_3', b: 'b_3', c: 'c_3'},
];
beforeEach(() => {
setupTableTestApp(CdkTableWithDifferentDataInputsApp);
});
it('should render with data array input', () => {
con... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(CdkTableWithDifferentDataInputsApp);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const data = baseData.slice();
component.dataSource = data;
fixture.detectChanges();
const expectedRender = [
['Column A', 'Column B', 'Column C'],
['a_1', 'b_1', 'c_1'],
['a_2', 'b_2', 'c_2'],
['a_3', 'b_3', 'c_3'],
];
expectTableToMatchCont... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const data = baseData.slice();
const stream = new BehaviorSubject<TestData[]>(data);
component.dataSource = stream;
fixture.detectChanges();
const expectedRender = [
['Column A', 'Column B', 'Column C'],
['a_1', 'b_1', 'c_1'],
['a_2', 'b_2', 'c_2'],
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
component.dataSource = {invalid: 'dataSource'};
expect(() => fixture.detectChanges()).toThrowError(getTableUnknownDataSourceError().message);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
component.dataSource = undefined;
fixture.detectChanges();
// Expect the table to render just the header, no rows
expectTableToMatchContent(tableElement, [
['Column A', 'Column B', 'Column C']
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should be able to render without a header row def', () => {
setupTableTestApp(MissingHeaderRowDefCdkTableApp);
expectTableToMatchContent(tableElement, [
['a_1'], // Data rows
['a_2'],
['a_3'],
['Footer A'], // Footer row
]);
});
it('should be... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(MissingHeaderRowDefCdkTableApp);
expectTableToMatchContent(tableElement, [
['a_1'], // Data rows
['a_2'],
['a_3'],
['Footer A'], // Footer row
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(MissingRowDefCdkTableApp);
expectTableToMatchContent(tableElement, [
['Column A'], // Header row
['Footer A'], // Footer row
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(MissingFooterRowDefCdkTableApp);
expectTableToMatchContent(tableElement, [
['Column A'], // Header row
['a_1'], // Data rows
['a_2'],
['a_3'],
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const thisFixture = createComponent(NativeHtmlTableApp);
const thisTableElement = thisFixture.nativeElement.querySelector('table');
thisFixture.detectChanges();
expectTableToMatchContent(thisTableElement, [
['Column A', 'Column B', 'Column C'],
['a_1', 'b_1', 'c_1'],
['a_2', ... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const thisFixture = createComponent(NestedHtmlTableApp);
thisFixture.detectChanges();
const outerTable = thisFixture.nativeElement.querySelector('table');
const innerTable = outerTable.querySelector('table');
const outerRows = Array.from<HTMLTableRowElement>(outerTable.querySelector('tbody'... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => row.cells.length | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const thisFixture = createComponent(NativeHtmlTableApp);
thisFixture.detectChanges();
// Assert that the data is inside the tbody specifically.
const tbody = thisFixture.nativeElement.querySelector('tbody');
const dataSource = thisFixture.componentInstance.dataSource!;
const originalDa... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const thisFixture = createComponent(NativeHtmlTableApp);
const thisTableElement: HTMLTableElement = thisFixture.nativeElement.querySelector('table');
thisFixture.detectChanges();
const rowGroups = Array.from(thisTableElement.querySelectorAll('thead, tbody, tfoot'));
expect(rowGroups.length... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const thisFixture = createComponent(NativeTableWithNoHeaderOrFooterRows);
const thisTableElement: HTMLTableElement = thisFixture.nativeElement.querySelector('table');
thisFixture.detectChanges();
const rowGroups: HTMLElement[] = Array.from(thisTableElement.querySelectorAll('thead, tfoot'));
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(BooleanRowCdkTableApp);
expectTableToMatchContent(tableElement, [
[''], // Header row
['false'], // Data rows
['true'],
['false'],
['true'],
]);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(CrazyColumnNameCdkTableApp);
// Column was named 'crazy-column-NAME-1!@#$%^-_&*()2'
const header = getHeaderRows(tableElement)[0];
expect(getHeaderCells(header)[0].classList)
.toContain('cdk-column-crazy-column-NAME-1-------_----2');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
setupTableTestApp(CustomRoleCdkTableApp);
expect(tableElement.getAttribute('role')).toBe('treegrid');
expect(getHeaderRows(tableElement)[0].getAttribute('role')).toBe('row');
const header = getHeaderRows(tableElement)[0];
getHeaderCells(header).forEach(cell => {
expect(cell.getAttrib... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
cell => {
expect(cell.getAttribute('role')).toBe('columnheader');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
row => {
expect(row.getAttribute('role')).toBe('row');
getCells(row).forEach(cell => {
expect(cell.getAttribute('role')).toBe('gridcell');
});
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
cell => {
expect(cell.getAttribute('role')).toBe('gridcell');
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(() => createComponent(DuplicateColumnDefNameCdkTableApp).detectChanges())
.toThrowError(getTableDuplicateColumnNameError('column_a').message);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => createComponent(DuplicateColumnDefNameCdkTableApp).detectChanges() | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(() => createComponent(MissingColumnDefCdkTableApp).detectChanges())
.toThrowError(getTableUnknownColumnError('column_a').message);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => createComponent(MissingColumnDefCdkTableApp).detectChanges() | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(() => createComponent(TableWithIndirectDescendantDefs).detectChanges()).not.toThrow();
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => createComponent(TableWithIndirectDescendantDefs).detectChanges() | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
const columnDefinitionMissingAfterRenderFixture =
createComponent(MissingColumnDefAfterRenderCdkTableApp);
expect(() => {
columnDefinitionMissingAfterRenderFixture.detectChanges();
flush();
columnDefinitionMissingAfterRenderFixture.detectChanges();
}).... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
columnDefinitionMissingAfterRenderFixture.detectChanges();
flush();
columnDefinitionMissingAfterRenderFixture.detectChanges();
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(() => createComponent(MissingAllRowDefsCdkTableApp).detectChanges())
.toThrowError(getTableMissingRowDefsError().message);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.