-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/validate-tokens-check
- Loading branch information
Showing
19 changed files
with
1,543 additions
and
1,253 deletions.
There are no files selected for viewing
564 changes: 282 additions & 282 deletions
564
ee/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_query.ambr
Large diffs are not rendered by default.
Oops, something went wrong.
135 changes: 113 additions & 22 deletions
135
frontend/src/scenes/dashboard/newDashboardLogic.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,132 @@ | ||
import { NodeKind } from '~/queries/schema' | ||
|
||
import { applyTemplate } from './newDashboardLogic' | ||
|
||
describe('template function in newDashboardLogic', () => { | ||
it('ignores unused variables', () => { | ||
expect( | ||
applyTemplate({ a: 'hello', b: 'hi' }, [ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
applyTemplate( | ||
{ a: 'hello', b: 'hi' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
]) | ||
], | ||
null | ||
) | ||
).toEqual({ a: 'hello', b: 'hi' }) | ||
}) | ||
it('uses identified variables', () => { | ||
expect( | ||
applyTemplate({ a: '{VARIABLE_1}', b: 'hi' }, [ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}', b: 'hi' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
event: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
]) | ||
], | ||
null | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
}, | ||
b: 'hi', | ||
}) | ||
}) | ||
|
||
it('replaces variables in query based tiles', () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.TrendsQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
kind: 'EventsNode', | ||
math: 'total', | ||
}, | ||
}) | ||
}) | ||
|
||
it("removes the math property from query based tiles that don't support it", () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.LifecycleQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
event: '$pageview', | ||
kind: 'EventsNode', | ||
}, | ||
}) | ||
}) | ||
|
||
it('removes the math property from retention insight tiles', () => { | ||
expect( | ||
applyTemplate( | ||
{ a: '{VARIABLE_1}' }, | ||
[ | ||
{ | ||
id: 'VARIABLE_1', | ||
name: 'a', | ||
default: { | ||
id: '$pageview', | ||
math: 'dau' as any, | ||
type: 'events' as any, | ||
}, | ||
description: 'The description of the variable', | ||
required: true, | ||
type: 'event', | ||
}, | ||
], | ||
NodeKind.RetentionQuery | ||
) | ||
).toEqual({ | ||
a: { | ||
id: '$pageview', | ||
type: 'events', | ||
}, | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.