type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}}</cdk-cell>
</ng-container>
</cdk-table>
`
})
class MissingAllRowDefsCdk... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
<cdk-footer-cell *cdkFooterCellDef> Footer A </cdk-footer-cell>... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
<cdk-footer-cell *cdkFooterCellDef> Footer A </cdk-footer-cell>... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
<cdk-footer-cell *cdkFooterCellDef> Footer A </cdk-footer-cell>... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}}</cdk-cell>
</ng-container>
<cdk-header-row *cdkHeaderRowDef="undefined... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell>
<cdk-cell *cdkCellDef="let row; let first = first;
let last = last; let even = even; let odd = ... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'wrapper-table',
template: `
<cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="content_column_a">
<cdk-header-cell *cdkHeaderCellDef> Content Column A </cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
</ng-container>
... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<wrapper-table [dataSource]="dataSource" [columns]="columnsToRender">
<ng-container cdkColumnDef="injected_column_a">
<cdk-header-cell *cdkHeaderCellDef> Injected Column A </cdk-header-cell>
<cdk-cell *cdkCellDef="let row"> {{row.a}} </cdk-cell>
</ng-container... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<table cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<th cdk-header-cell *cdkHeaderCellDef> Column A</th>
<td cdk-cell *cdkCellDef="let row"> {{row.a}}</td>
</ng-container>
<ng-container cdkColumnDef="column_b">
<th... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<table cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<th cdk-header-cell *cdkHeaderCellDef> Column A</th>
<td cdk-cell *cdkCellDef="let row">{{row.a}}</td>
</ng-container>
<ng-container cdkColumnDef="column_b">
<th ... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<table cdk-table [dataSource]="dataSource">
<ng-container cdkColumnDef="column_a">
<th cdk-header-cell *cdkHeaderCellDef> Column A</th>
<td cdk-cell *cdkCellDef="let row"> {{row.a}}</td>
</ng-container>
<ng-container cdkColumnDef="column_b">
<th... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<table cdk-table [dataSource]="dataSource">
<caption>Very important data</caption>
<ng-container cdkColumnDef="column_a">
<th cdk-header-cell *cdkHeaderCellDef> Column A</th>
<td cdk-cell *cdkCellDef="let row"> {{row.a}}</td>
</ng-container>
<tr c... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
template: `
<table cdk-table [dataSource]="dataSource">
<colgroup>
<col>
</colgroup>
<col>
<ng-container cdkColumnDef="column_a">
<th cdk-header-cell *cdkHeaderCellDef> Column A</th>
<td cdk-cell *cdkCellDef="let row"> {{row.a}}</td>
</ng-contain... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ClassDeclaration |
@Component({
// Note that we need the `ngSwitch` below in order to surface the issue we're testing for.
template: `
<cdk-table [dataSource]="dataSource">
<ng-container [ngSwitch]="true">
<ng-container cdkColumnDef="column_a">
<cdk-header-cell *cdkHeaderCellDef> Column A</cdk-header-cell... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
InterfaceDeclaration |
interface PositionDirections {
[key: string]: string | undefined;
top?: string;
bottom?: string;
left?: string;
right?: string;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
InterfaceDeclaration |
interface TestData {
a: string;
b: string;
c: string;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
connect(collectionViewer: CollectionViewer) {
this.isConnected = true;
return combineLatest([this._dataChange, collectionViewer.viewChange])
.pipe(map(data => data[0]));
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
disconnect() {
this.isConnected = false;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
addData() {
const nextIndex = this.data.length + 1;
let copiedData = this.data.slice();
copiedData.push({
a: `a_${nextIndex}`,
b: `b_${nextIndex}`,
c: `c_${nextIndex}`
});
this.data = copiedData;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
connect(): Observable<boolean[]> {
return this._dataChange;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
disconnect() {} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
showIndexColumns() {
const indexColumns = ['index', 'dataIndex', 'renderIndex'];
this.columnsToRender = indexColumns;
this.columnsForIsIndex1Row = indexColumns;
this.columnsForHasC3Row = indexColumns;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
stickyColumnsUpdated(update: StickyUpdate) {
this.mostRecentStickyColumnsUpdate = update;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
stickyEndColumnsUpdated(update: StickyUpdate) {
this.mostRecentStickyEndColumnsUpdate = update;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
stickyHeaderRowsUpdated(update: StickyUpdate) {
this.mostRecentStickyHeaderRowsUpdate = update;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
stickyFooterRowsUpdated(update: StickyUpdate) {
this.mostRecentStickyFooterRowsUpdate = update;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
isStuck(list: string[], id: string) {
return list.indexOf(id) != -1;
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
ngAfterViewInit() {
setTimeout(() => {
this.displayedColumns = ['column_a'];
}, 0);
} | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
MethodDeclaration |
ngAfterContentInit() {
// Register the content's column, row, and header row definitions.
this.columnDefs.forEach(columnDef => this.table.addColumnDef(columnDef));
this.rowDefs.forEach(rowDef => this.table.addRowDef(rowDef));
this.table.addHeaderRowDef(this.headerRowDef);
this.table.setNoDataRow(th... | AbuDeCoder/components | src/cdk/table/table.spec.ts | TypeScript |
ArrowFunction |
(
orderId: string,
dispatchingState: DispatchingState
) => {
// context
const api = React.useContext(ApiContext);
const getServerTime = useContextGetSeverTime();
// state
const [tick, setTick] = React.useState(0);
const [timestamp, setTimestmap] = React.useState<Date>();
const [elapsed, setElapsed] =... | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
() => {
const interval = setInterval(() => setTick((value) => value + 5), 5000);
return () => clearInterval(interval);
} | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
() => setTick((value) => value + 5) | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
(value) => value + 5 | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
() => {
return api
.order()
.observeOrderDispatchingStateTimestamp(orderId, dispatchingState, (change) => {
if (change) {
setTimestmap((change.timestamp as firebase.firestore.Timestamp).toDate());
}
});
} | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
(change) => {
if (change) {
setTimestmap((change.timestamp as firebase.firestore.Timestamp).toDate());
}
} | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
ArrowFunction |
() => {
if (!timestamp) return;
const now = (getServerTime ? getServerTime() : new Date()).getTime();
const diff = now - timestamp.getTime();
setElapsed(diff / 1000);
} | appjusto/app | common/store/api/order/hooks/useOrderDispatchingStateElapsedSeconds.ts | TypeScript |
FunctionDeclaration |
function clear() {
reset();
onSearch({ searchText: "" });
} | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
ArrowFunction |
({
className,
onSearch,
variant = "outline",
shadow = false,
inputClassName,
...rest
}) => {
const {
register,
handleSubmit,
watch,
reset,
formState: { errors },
} = useForm<SearchValue>({
defaultValues: {
searchText: "",
},
});
const searchText = watch("searchTex... | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
ArrowFunction |
() => {
if (!searchText) {
onSearch({ searchText: "" });
}
} | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
TypeAliasDeclaration |
type SearchProps = {
className?: string;
shadow?: boolean;
variant?: "normal" | "solid" | "outline";
inputClassName?: string;
onSearch: (data: SearchValue) => void;
}; | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
TypeAliasDeclaration |
type SearchValue = {
searchText: string;
}; | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
MethodDeclaration |
cn("w-full flex items-center relative", className) | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
MethodDeclaration |
handleSubmit(onSearch) | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
MethodDeclaration |
t("form:input-label-search") | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
MethodDeclaration |
t("form:input-placeholder-search") | lazynerd-studios/Grrenline-cart | admin/rest/src/components/common/search.tsx | TypeScript |
ArrowFunction |
() => {
const eventEmitter = new EventEmitter();
const exitPromise = new Promise<void>((resolve) => {
eventEmitter.on("exit", () => resolve());
});
const onExit = () => {
eventEmitter.emit("exit");
};
return {
exitPromise,
onExit,
};
} | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
(resolve) => {
eventEmitter.on("exit", () => resolve());
} | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
() => {
eventEmitter.emit("exit");
} | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
() => {
const results: Array<Result> = [];
const collectResult = (result: Result) => {
results.push(result);
};
return { results, collectResult };
} | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
(result: Result) => {
results.push(result);
} | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
async () => {
const resultHandler = buildResultHandler();
const consumerStrategy = new PriorityConsumerStrategy(logger,5);
const consumers = [
new TestCustomConsumer(logger,"A", resultHandler.collectResult, consumerStrategy),
new TestCustomConsumer(logger,"B", resultHa... | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
async () => {
const resultHandler = buildResultHandler();
const consumerStrategy = new TtlConsumerStrategy(logger, 0, 4);
const consumers = [
new TestCustomConsumer(logger,"A", resultHandler.collectResult, consumerStrategy),
new TestCustomConsumer(logger,"B", resultHan... | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
async () => {
const resultHandler = buildResultHandler();
const consumerStrategy = new PredicateConsumerStrategy(logger, "data_0", 3);
const consumers = [
new TestCustomConsumer(logger,"A", resultHandler.collectResult, consumerStrategy),
new TestCustomConsumer(logger,"... | grzpab/priority-message-system | tests/test.test.ts | TypeScript |
ArrowFunction |
() => mockImagePlacerUtil | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
(num: number) => parseFloat(num.toFixed(5)) | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
(
props: Partial<ImagePlacerProps> = defaultProps,
imageSourceWidth?: number,
imageSourceHeight?: number,
): SetupInfo => {
const onDragStart = jest.fn();
const onDragMove = jest.fn();
const onWheel = jest.fn();
const onZoomChange = jest.fn();
const onSaveImage = jest.fn();
let wrapper = shallow(
... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should show image if loads successfully', () => {
const { wrapper } = setup();
const img = wrapper.find(ImagePlacerImage);
expect(img).toHaveLength(1);
expect(img.props().src).toEqual('some-src');
});
it('should set error state if image load fails', () => {
const ... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { wrapper } = setup();
const img = wrapper.find(ImagePlacerImage);
expect(img).toHaveLength(1);
expect(img.props().src).toEqual('some-src');
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { wrapper } = setup();
const img = wrapper.find(ImagePlacerImage);
img.props().onError('some-error');
expect(wrapper.state('errorMessage')).toEqual('some-error');
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup();
jest.spyOn(instance, 'zoomToFit');
instance.onImageLoad({} as any, smallSize, smallSize);
expect(instance.zoomToFit).toHaveBeenCalled();
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
done => {
setup({
...defaultProps,
onImageActions: (api: ImageActions) => {
expect(api).toHaveProperty('toCanvas');
expect(api).toHaveProperty('toDataURL');
expect(api).toHaveProperty('toFile');
done();
},
});
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
(api: ImageActions) => {
expect(api).toHaveProperty('toCanvas');
expect(api).toHaveProperty('toDataURL');
expect(api).toHaveProperty('toFile');
done();
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
async () => {
const { instance } = setup(
{
...defaultProps,
useConstraints: false,
},
smallSize,
mediumSize,
);
expect(instance.state.imageWidth).toEqual(smallSize);
expect(instance.state.imageHeight).toEqual(mediumSize);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
async () => {
const { instance } = setup(defaultProps, smallSize, mediumSize);
const { containerWidth, containerHeight } = instance.props;
expect(instance.state.imageWidth).toEqual(containerWidth);
expect(instance.state.imageHeight).toEqual(
containerHeight * smallToMediumRatio,
)... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should be equal to container size plus margins', () => {
const { instance } = setup();
const {
containerRectWithMargins,
props: { margin, containerWidth, containerHeight },
} = instance;
const doubleMargin = margin * 2;
expect(containerRectW... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup();
const {
containerRectWithMargins,
props: { margin, containerWidth, containerHeight },
} = instance;
const doubleMargin = margin * 2;
expect(containerRectWithMargins.width).toEqual(
containerWidth + doubleMargin,... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should be equal to container size minus margins', () => {
const { instance } = setup();
const {
visibleBounds,
props: { containerWidth, containerHeight },
} = instance;
expect(visibleBounds.width).toEqual(containerWidth);
expect(visibleBound... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup();
const {
visibleBounds,
props: { containerWidth, containerHeight },
} = instance;
expect(visibleBounds.width).toEqual(containerWidth);
expect(visibleBounds.height).toEqual(containerHeight);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should scale and move image correctly when zooming with no constraints', () => {
const { instance } = setup(
{
...defaultProps,
useConstraints: false,
},
smallSize,
mediumSize,
);
for (let zoom = 0; zoom <= zoomSt... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup(
{
...defaultProps,
useConstraints: false,
},
smallSize,
mediumSize,
);
for (let zoom = 0; zoom <= zoomSteps; zoom++) {
const currentZoom = zoom / zoomSteps;
const center = ins... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup(defaultProps, smallSize, mediumSize);
const {
props: { containerWidth, containerHeight },
} = instance;
for (let zoom = 0; zoom <= zoomSteps; zoom++) {
const currentZoom = zoom / zoomSteps;
const center = instance.imageBou... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should zero imageSize, origin, and zoom when reset', async () => {
const zoom = 0.5;
const { instance } = setup(
{
...defaultProps,
zoom,
},
smallSize,
smallSize,
);
instance.state.originX = 50;
in... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
async () => {
const zoom = 0.5;
const { instance } = setup(
{
...defaultProps,
zoom,
},
smallSize,
smallSize,
);
instance.state.originX = 50;
instance.state.originX = 60;
instance.reset();
expect(ins... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
describe('Using Constraints', () => {
it('should snap left/right edges', () => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeS... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should snap left/right edges', () => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x += 1) {
instance.state.... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x += 1) {
instance.state.originX = x;
instance.applyConstraint... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x += 1) {
instance.state.originX = x;
instance.applyConstraints();
expect(instance.im... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints()... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints();
expect(instance.image... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should snap left edge', () => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x++) {
instance.state.originX = ... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x++) {
instance.state.originX = x;
instance.applyConstraints()... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x++) {
instance.state.originX = x;
instance.applyConstraints();
expect(instance.image... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints()... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints();
expect(instance.image... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints()... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let y = -largeSize; y <= largeSize; y++) {
instance.state.originY = y;
instance.applyConstraints();
expect(instance.image... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x++) {
instance.state.originX = x;
instance.applyConstraints()... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { visibleBounds } = instance;
for (let x = -largeSize; x <= largeSize; x++) {
instance.state.originX = x;
instance.applyConstraints();
expect(instance.image... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should scale image up/down if imageSourceRect different than visibleBounds when using constraints', () => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { imageBounds } = instance;
expect(imageBounds.widt... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { imageBounds } = instance;
expect(imageBounds.width).toEqual(mediumSize);
expect(imageBounds.height).toEqual(mediumSize);
});
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(defaultProps, imageSize, imageSize);
const { imageBounds } = instance;
expect(imageBounds.width).toEqual(mediumSize);
expect(imageBounds.height).toEqual(mediumSize);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
imageSizes.forEach(imageSize => {
const { instance } = setup(
{
...defaultProps,
useConstraints: false,
},
imageSize,
imageSize,
);
const { imageBounds } = instance;
expect(imageBounds.wi... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
imageSize => {
const { instance } = setup(
{
...defaultProps,
useConstraints: false,
},
imageSize,
imageSize,
);
const { imageBounds } = instance;
expect(imageBounds.width).toEqual(imageSize);
... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup();
jest.spyOn(instance, 'zoomToFit');
instance.onImageLoad({} as any, 0, 0);
expect(instance.zoomToFit).not.toHaveBeenCalled();
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup({
...defaultProps,
useConstraints: false,
});
jest.spyOn(instance, 'zoomToFit');
instance.onImageLoad({} as any, smallSize, smallSize);
expect(instance.zoomToFit).not.toHaveBeenCalled();
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance, onZoomChange } = setup();
instance.zoomToFit();
expect(onZoomChange).toHaveBeenCalledTimes(1);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
it('should map equally when imageBounds and visibleBounds equal', () => {
const { instance } = setup(defaultProps, ...imageSizeMedium);
const corner = instance.transformVisibleBoundsToImageCoords(
containerSize,
containerSize,
);
expect(corner.x).toEqua... | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup(defaultProps, ...imageSizeMedium);
const corner = instance.transformVisibleBoundsToImageCoords(
containerSize,
containerSize,
);
expect(corner.x).toEqual(mediumSize);
expect(corner.y).toEqual(mediumSize);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup(defaultProps, ...imageSizeSmall);
const corner = instance.transformVisibleBoundsToImageCoords(
containerSize,
containerSize,
);
expect(corner.x).toEqual(smallSize);
expect(corner.y).toEqual(smallSize);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
ArrowFunction |
() => {
const { instance } = setup(defaultProps, ...imageSizeLarge);
const corner = instance.transformVisibleBoundsToImageCoords(
containerSize,
containerSize,
);
expect(corner.x).toEqual(largeSize);
expect(corner.y).toEqual(largeSize);
} | HeartCommunity/uiKit | packages/media/media-avatar-picker/src/__tests__/unit/image-placerSpec.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.