Skip to content

Commit

Permalink
fix wrong type cast on AppsMenuProvider.readLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Jan 10, 2020
1 parent 12f469d commit f488946
Show file tree
Hide file tree
Showing 34 changed files with 73 additions and 225 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Management']);
});

Expand Down Expand Up @@ -125,9 +123,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows Management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Management']);
});

Expand Down Expand Up @@ -178,9 +174,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows Management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Discover', 'Management']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Management');
});

Expand Down
13 changes: 3 additions & 10 deletions x-pack/test/functional/apps/apm/feature_controls/apm_security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('shows apm navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link: Record<string, string>) => link.text)).to.eql([
'APM',
'Management',
]);
expect(navLinks.map(link => link.text)).to.eql(['APM', 'Management']);
});

it('can navigate to APM app', async () => {
Expand Down Expand Up @@ -111,9 +108,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows apm navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['APM', 'Management']);
});

Expand Down Expand Up @@ -166,9 +161,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it(`doesn't show APM navlink`, async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('APM');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('APM');
});

Expand Down Expand Up @@ -61,9 +59,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('APM');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows canvas navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Canvas', 'Management']);
});

Expand Down Expand Up @@ -143,9 +141,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows canvas navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Canvas', 'Management']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Canvas');
});

Expand Down Expand Up @@ -98,9 +96,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Canvas');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('shows dashboard navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link: Record<string, string>) => link.text)).to.eql([
'Dashboard',
'Management',
]);
expect(navLinks.map(link => link.text)).to.eql(['Dashboard', 'Management']);
});

it(`landing page shows "Create new Dashboard" button`, async () => {
Expand Down Expand Up @@ -255,9 +252,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows dashboard navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Dashboard', 'Management']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Dashboard');
});

Expand Down Expand Up @@ -107,9 +105,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Dashboard');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('shows Dev Tools navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link: Record<string, string>) => link.text)).to.eql([
'Dev Tools',
'Management',
]);
expect(navLinks.map(link => link.text)).to.eql(['Dev Tools', 'Management']);
});

describe('console', () => {
Expand Down Expand Up @@ -146,9 +143,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it(`shows 'Dev Tools' navlink`, async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Dev Tools', 'Management']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Dev Tools');
});

Expand Down Expand Up @@ -79,9 +77,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Dev Tools');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('shows discover navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link: Record<string, string>) => link.text)).to.eql([
'Discover',
'Management',
]);
expect(navLinks.map(link => link.text)).to.eql(['Discover', 'Management']);
});

it('shows save button', async () => {
Expand Down Expand Up @@ -170,9 +167,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows discover navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Discover', 'Management']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Discover');
});

Expand Down Expand Up @@ -93,9 +91,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Discover');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('EEndpoint');
});

Expand Down Expand Up @@ -70,9 +68,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('EEndpoint');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {

it('shows graph navlink', async () => {
const navLinks = await appsMenu.readLinks();
expect(navLinks.map((link: Record<string, string>) => link.text)).to.eql([
'Graph',
'Management',
]);
expect(navLinks.map(link => link.text)).to.eql(['Graph', 'Management']);
});

it('landing page shows "Create new graph" button', async () => {
Expand Down Expand Up @@ -129,9 +126,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows graph navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Graph', 'Management']);
});

Expand Down Expand Up @@ -183,9 +178,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it(`doesn't show graph navlink`, async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Graph');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.contain('Graph');
});

Expand Down Expand Up @@ -75,9 +73,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('home', {
basePath: '/s/custom_space',
});
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).not.to.contain('Graph');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Management']);
});

Expand Down Expand Up @@ -125,9 +123,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Management']);
});

Expand Down Expand Up @@ -179,9 +175,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
});

it('shows Management navlink', async () => {
const navLinks = (await appsMenu.readLinks()).map(
(link: Record<string, string>) => link.text
);
const navLinks = (await appsMenu.readLinks()).map(link => link.text);
expect(navLinks).to.eql(['Discover', 'Management']);
});

Expand Down
Loading

0 comments on commit f488946

Please sign in to comment.