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

[7.11] [Uptime] Unskip "Observer location" test block (#87571) #88479

Merged
merged 1 commit into from
Jan 15, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import * as t from 'io-ts';

export const OverviewFiltersType = t.type({
export const OverviewFiltersType = t.partial({
locations: t.array(t.string),
ports: t.array(t.number),
schemes: t.array(t.string),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const AlertMonitorStatus: React.FC<Props> = ({
enabled={enabled}
hasFilters={!!overviewFilters?.filters}
isOldAlert={isOldAlert}
locations={locations}
locations={locations || []}
numTimes={numTimes}
setAlertParams={setAlertParams}
shouldUpdateUrl={shouldUpdateUrl}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const Container = styled(EuiFilterGroup)`
margin-bottom: 10px;
`;

function isDisabled<T>(array?: T[]) {
return array ? array.length === 0 : true;
}

export const FilterGroupComponent: React.FC<PresentationalComponentProps> = ({
overviewFilters,
loading,
Expand Down Expand Up @@ -51,7 +55,7 @@ export const FilterGroupComponent: React.FC<PresentationalComponentProps> = ({
onFilterFieldChange,
fieldName: 'observer.geo.name',
id: 'location',
items: locations,
items: locations || [],
selectedItems: selectedLocations,
title: filterLabels.LOCATION,
},
Expand All @@ -63,8 +67,8 @@ export const FilterGroupComponent: React.FC<PresentationalComponentProps> = ({
onFilterFieldChange,
fieldName: 'url.port',
id: 'port',
disabled: ports.length === 0,
items: ports.map((p: number) => p.toString()),
disabled: isDisabled(ports),
items: ports?.map((p: number) => p.toString()) ?? [],
selectedItems: selectedPorts,
title: filterLabels.PORT,
},
Expand All @@ -73,8 +77,8 @@ export const FilterGroupComponent: React.FC<PresentationalComponentProps> = ({
onFilterFieldChange,
fieldName: 'monitor.type',
id: 'scheme',
disabled: schemes.length === 0,
items: schemes,
disabled: isDisabled(schemes),
items: schemes ?? [],
selectedItems: selectedSchemes,
title: filterLabels.SCHEME,
},
Expand All @@ -83,8 +87,8 @@ export const FilterGroupComponent: React.FC<PresentationalComponentProps> = ({
onFilterFieldChange,
fieldName: 'tags',
id: 'tags',
disabled: tags.length === 0,
items: tags,
disabled: isDisabled(tags),
items: tags ?? [],
selectedItems: selectedTags,
title: filterLabels.TAGS,
},
Expand Down
3 changes: 1 addition & 2 deletions x-pack/test/functional/apps/uptime/locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await makeChecksWithStatus(es, LessAvailMonitor, 5, 2, 10000, {}, 'down');
};

// FLAKY: https://github.com/elastic/kibana/issues/85208
describe.skip('Observer location', () => {
describe('Observer location', () => {
const start = '~ 15 minutes ago';
const end = 'now';

Expand Down