Пример #1
0
 it('should return `["aggregation", 1]` for second aggregation column if list of columns was provided', () => {
   expect(
     fieldRefForColumn(AGGREGATION_COLUMN, [
       { source: "aggregation" },
       AGGREGATION_COLUMN,
     ]),
   ).toEqual(["aggregation", 1]);
 });
Пример #2
0
 it('should return `["field-id", 1]` for a normal column', () => {
   expect(fieldRefForColumn(FIELD_COLUMN)).toEqual(["field-id", 1]);
 });
Пример #3
0
 it("should return `id` if is an MBQL clause", () => {
   expect(fieldRefForColumn({ id: ["field-id", 3] })).toEqual([
     "field-id",
     3,
   ]);
 });
Пример #4
0
 it('should return `["aggregation", 0]` for aggregation column if list of columns was provided', () => {
   expect(
     fieldRefForColumn(AGGREGATION_COLUMN, [AGGREGATION_COLUMN]),
   ).toEqual(["aggregation", 0]);
 });
Пример #5
0
 it("should return `null` for aggregation column if list of columns was provided", () => {
   expect(fieldRefForColumn(AGGREGATION_COLUMN)).toEqual(null);
 });
Пример #6
0
 it('should return `["expression", 2, 1]` for a fk column', () => {
   expect(fieldRefForColumn(EXPRESSION_COLUMN)).toEqual([
     "expression",
     "foo",
   ]);
 });
Пример #7
0
 it('should return `["fk->", 2, 1]` for a fk column', () => {
   expect(fieldRefForColumn(FK_COLUMN)).toEqual(["fk->", 2, 1]);
 });