Skip to content

Commit

Permalink
Convert discover_page to ts, remove redundunt methods (elastic#59312)
Browse files Browse the repository at this point in the history
* convert discover_page to ts

* remove deuplicated methods, improve tests
  • Loading branch information
dmlemeshko authored Mar 5, 2020
1 parent 61a8b78 commit c42bd33
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1 class="euiScreenReaderOnly">{{screenTitle}}</h1>

<main class="container-fluid">
<div class="row">
<div class="col-md-2 sidebar-container collapsible-sidebar" id="discover-sidebar">
<div class="col-md-2 sidebar-container collapsible-sidebar" id="discover-sidebar" data-test-subj="discover-sidebar">
<div class="dscFieldChooser">
<disc-field-chooser
columns="state.columns"
Expand Down
7 changes: 4 additions & 3 deletions test/functional/apps/discover/_discover_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function({ getService, getPageObjects }) {
const log = getService('log');
const esArchiver = getService('esArchiver');
const browser = getService('browser');
const elasticChart = getService('elasticChart');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['settings', 'common', 'discover', 'header', 'timePicker']);
const defaultSettings = {
Expand Down Expand Up @@ -64,7 +65,7 @@ export default function({ getService, getPageObjects }) {
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Monthly');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
});
it('should visualize weekly data with within DST changes', async () => {
Expand All @@ -74,7 +75,7 @@ export default function({ getService, getPageObjects }) {
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Weekly');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
});
it('should visualize monthly data with different years Scaled to 30d', async () => {
Expand All @@ -84,7 +85,7 @@ export default function({ getService, getPageObjects }) {
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.setChartInterval('Daily');
await PageObjects.header.waitUntilLoadingHasFinished();
const chartCanvasExist = await PageObjects.discover.chartCanvasExist();
const chartCanvasExist = await elasticChart.canvasExists();
expect(chartCanvasExist).to.be(true);
});
});
Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/discover/_source_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default function({ getService, getPageObjects }) {
});

it('should not get the field referer', async function() {
//let fieldNames;
const fieldNames = await PageObjects.discover.getAllFieldNames();
expect(fieldNames).to.not.contain('referer');
const relatedContentFields = fieldNames.filter(
Expand Down
Loading

0 comments on commit c42bd33

Please sign in to comment.