Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/embed/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2676,6 +2676,14 @@ describe('App embed tests', () => {
testSetIframeHeightBehavior('/some/other/path/', true);
});

test('should not call setIFrameHeight if currentPath is the bare Spotter landing route "/insights/conv-assist"', () => {
testSetIframeHeightBehavior('/insights/conv-assist', false);
});

test('should not call setIFrameHeight if currentPath starts with "/embed/insights/conv-assist/s/" (conversation id set mid-stream)', () => {
testSetIframeHeightBehavior('/embed/insights/conv-assist/s/abc123', false);
});

test('should update iframe height correctly', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
34 changes: 34 additions & 0 deletions src/embed/liveboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,40 @@ describe('Liveboard/viz embed tests', () => {
expect(spySetIFrameHeight).toHaveBeenCalled();
});

test('should not call setIFrameHeight if currentPath is the bare Spotter landing route "/insights/conv-assist"', () => {
const myObject = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
fullHeight: true,
liveboardId,
} as LiveboardViewConfig) as any;
const spySetIFrameHeight = jest.spyOn(myObject, 'setIFrameHeight');

myObject.render();
myObject.fullHeightController.handleRouteChange({
data: { currentPath: '/insights/conv-assist' },
type: 'Route',
});

expect(spySetIFrameHeight).not.toHaveBeenCalled();
});

test('should not call setIFrameHeight if currentPath starts with "/embed/insights/conv-assist/s/" (conversation id set mid-stream)', () => {
const myObject = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
fullHeight: true,
liveboardId,
} as LiveboardViewConfig) as any;
const spySetIFrameHeight = jest.spyOn(myObject, 'setIFrameHeight');

myObject.render();
myObject.fullHeightController.handleRouteChange({
data: { currentPath: '/embed/insights/conv-assist/s/abc123' },
type: 'Route',
});

expect(spySetIFrameHeight).not.toHaveBeenCalled();
});

test('Should set the visible vizs', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
8 changes: 8 additions & 0 deletions src/full-height.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ const LIVEBOARD_RELATED_ROUTES = [
'/insights/liveboard/',
'/tsl-editor/PINBOARD_ANSWER_BOOK/',
'/import-tsl/PINBOARD_ANSWER_BOOK/',
// Spotter (conv-assist) routes. Without these, navigating into or within
// Spotter resets the frame to defaultHeight, clobbering the fullHeight
// layout both on initial route (the bare route has no trailing segment,
// e.g. "/insights/conv-assist") and again mid-stream, when the
// conversation gets a real id and the URL is updated to
// "/insights/conv-assist/s/{id}".
'/insights/conv-assist',
'/embed/insights/conv-assist',
];

/**
Expand Down
Loading