Skip to content

Commit

Permalink
refactoring eui component
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Jun 22, 2021
1 parent 00d88ff commit 585dcb9
Show file tree
Hide file tree
Showing 9 changed files with 521 additions and 566 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('getCommands', () => {
it('renders empty command', () => {
const commands = getCommands({
variantId: 'foo',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand All @@ -24,7 +24,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'java',
environmentDetails: {},
policyDetails: {},
});
expect(commands).toMatchInlineSnapshot(`
"java -javaagent:/path/to/elastic-apm-agent-<version>.jar \\\\
Expand All @@ -39,7 +39,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'java',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand All @@ -60,7 +60,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'js',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -84,7 +84,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'js',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'node',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -138,7 +138,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'node',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'django',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -203,7 +203,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'django',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -243,7 +243,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'flask',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -275,7 +275,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'flask',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -312,7 +312,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'rails',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -335,7 +335,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'rails',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -363,7 +363,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'rack',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -386,7 +386,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'rack',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'go',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -438,7 +438,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'go',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down Expand Up @@ -467,7 +467,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'dotnet',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -484,7 +484,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'dotnet',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand All @@ -506,7 +506,7 @@ describe('getCommands', () => {
it('renders empty commands', () => {
const commands = getCommands({
variantId: 'php',
environmentDetails: {},
policyDetails: {},
});
expect(commands).not.toBe('');
expect(commands).toMatchInlineSnapshot(`
Expand All @@ -519,7 +519,7 @@ describe('getCommands', () => {
it('renders with secret token and url', () => {
const commands = getCommands({
variantId: 'php',
environmentDetails: {
policyDetails: {
apmServerUrl: 'localhost:8220',
secretToken: 'foobar',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const commandsMap: Record<string, string> = {

export function getCommands({
variantId,
environmentDetails,
policyDetails,
}: {
variantId: string;
environmentDetails: {
policyDetails: {
apmServerUrl?: string;
secretToken?: string;
};
Expand All @@ -44,5 +44,5 @@ export function getCommands({
if (!commands) {
return '';
}
return Mustache.render(commands, environmentDetails);
return Mustache.render(commands, policyDetails);
}

This file was deleted.

Loading

0 comments on commit 585dcb9

Please sign in to comment.