Skip to content

Commit

Permalink
fix(aws/lambda): Shows function details and actions menu. (backport #…
Browse files Browse the repository at this point in the history
…9199) (#9516)

* fix(aws/lambda): Shows function details and actions menu.

* fix(aws/lambda): Shows function details and actions menu.

Co-authored-by: Zach Smith <33258732+zachsmith1@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
(cherry picked from commit c39f74d)

Co-authored-by: Raúl Vázquez <raul.vazquez@armory.io>
  • Loading branch information
mergify[bot] and rvazquezglez committed Sep 2, 2021
1 parent 2c728d0 commit 3aa3efc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { shallow } from 'enzyme';

import { Application } from '@spinnaker/core';
import { IAmazonFunction, FunctionActions } from 'amazon';

describe('FunctionActions', () => {
it('should render correct state when all attributes exist', () => {
let app = { name: 'app' } as Application;

let functionDef = { functionName: 'app-function' } as IAmazonFunction;

const wrapper = shallow(
<FunctionActions
app={app}
functionDef={functionDef}
functionFromParams={{
account: 'test-account',
region: 'us-east-1',
functionName: 'function-name',
}}
/>,
);

let dropDown = wrapper.find('DropdownToggle');

expect(dropDown.childAt(0).text()).toEqual('Function Actions');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface IFunctionActionsState {
export class FunctionActions extends React.Component<IFunctionActionsProps, IFunctionActionsState> {
constructor(props: IFunctionActionsProps) {
super(props);
this.state = { application: props.app };
}

public componentDidMount(): void {
Expand Down

0 comments on commit 3aa3efc

Please sign in to comment.