Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for interpreter createSocket. #29459

Merged
merged 4 commits into from Jan 31, 2019

Conversation

@lukeelmers
Copy link
Member

commented Jan 28, 2019

Adds tests for the fix merged in #29393.

The root cause which that PR resolved was that we were passing the wrong config as an argument to createSocket.

All this unit test does is verify that the argument is pulled from the correct place in the config.

I also added a functional test for this issue. It loads different sample data in 2 different spaces, then verifies that the sample dashboards fully render.

@lukeelmers lukeelmers changed the title Add test for interpreter createSocket [WIP] Add test for interpreter createSocket Jan 28, 2019

@lukeelmers lukeelmers added the WIP label Jan 28, 2019

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

@lukeelmers lukeelmers removed the WIP label Jan 29, 2019

@lukeelmers lukeelmers changed the title [WIP] Add test for interpreter createSocket Add tests for interpreter createSocket. Jan 29, 2019

getBasePath: jest.fn(() => '/abc/s/123'),
getInjected: jest.fn(config => { // eslint-disable-line no-unused-vars
return config === 'serverBasePath' ? '/abc' : '/123';
}),

This comment has been minimized.

Copy link
@lukeelmers

lukeelmers Jan 29, 2019

Author Member

It feels a little strange to test for this since the serverBasePath config name is arbitrarily set in the plugin's uiExports, but this will at least ensure no changes happen on the client that could cause things to break in the same way again.

await PageObjects.spaceSelector.switchToSpace(spaceId, {
redirectPath: paths.sampleData,
});
await PageObjects.home.removeSampleDataSet('flights');

This comment has been minimized.

Copy link
@lukeelmers

lukeelmers Jan 29, 2019

Author Member

TBH I'm not sure if removing the sample data is a necessary cleanup step for this test or not -- added it just to be safe.

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2019

@lukeelmers lukeelmers added the review label Jan 29, 2019

@lukeelmers lukeelmers requested review from LeeDr and ppisljar Jan 29, 2019

lukeelmers added 3 commits Jan 28, 2019

@lukeelmers lukeelmers force-pushed the lukeelmers:fix/vis-spaces branch from b4720f5 to 601cc2c Jan 30, 2019

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2019

@elasticmachine

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2019

@ppisljar
Copy link
Member

left a comment

LGTM

@legrego
Copy link
Contributor

left a comment

LGTM - thanks!

@lukeelmers lukeelmers merged commit 402b8cf into elastic:master Jan 31, 2019

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
kibana-ci Build finished.
Details

@lukeelmers lukeelmers deleted the lukeelmers:fix/vis-spaces branch Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.