-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge develop and feat-egress-store-role into feat-secure-work…
…space-egress (#735)
- Loading branch information
Showing
99 changed files
with
2,527 additions
and
11,928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
name: Mainline Protection | ||
on: | ||
pull_request: | ||
branches: | ||
- mainline | ||
# The purpose of this workflow is to create a failing Status check on pull request against mainline. This will prevent | ||
# PR from being merged into mainline. | ||
jobs: | ||
mainline-protection: | ||
name: Only create PR against develop branch, not mainline branch | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- run: failing-command # An invalid bash command to trigger failure of this workflow | ||
# | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
name: Mainline Protection | ||
on: | ||
pull_request: | ||
branches: | ||
- mainline | ||
# The purpose of this workflow is to create a failing Status check on pull request against mainline. This will prevent | ||
# PR from being merged into mainline. | ||
jobs: | ||
mainline-protection: | ||
name: Only create PR against develop branch, not mainline branch | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- run: failing-command # An invalid bash command to trigger failure of this workflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...as-ui/packages/base-raas-ui/src/parts/environments-sc/__tests__/ScEnvironmentCard.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
// Mock buttons to avoid error | ||
jest.mock('../parts/ScEnvironmentButtons', () => ({ | ||
__ScEnvironmentButtons: true, | ||
})); | ||
// eslint-disable-next-line import/first | ||
import {} from '../parts/ScEnvironmentButtons'; | ||
|
||
// const ScEnvironmentCard = require('../ScEnvironmentCard'); | ||
// eslint-disable-next-line import/first | ||
import ScEnvironmentCard from '../ScEnvironmentCard'; | ||
|
||
jest.mock('@aws-ee/base-ui/dist/helpers/notification'); | ||
const displayErrorMock = require('@aws-ee/base-ui/dist/helpers/notification'); | ||
|
||
const scEnvironment = { | ||
id: 'id', | ||
rev: 2, | ||
status: 'active', | ||
description: 'sample description', | ||
envTypeConfigId: 'env type config id', | ||
name: 'name', | ||
projectId: 'project id', | ||
envTypeId: 'env type id', | ||
createdAt: '01-01-1900', | ||
createdBy: 'anonymous', | ||
updatedAt: '01-02-1900', | ||
updatedBy: 'anonymous', | ||
error: 'error', | ||
connections: [], | ||
hasConnections: false, | ||
studyIds: [], | ||
cidr: [], | ||
outputs: [], | ||
}; | ||
|
||
const envTypesStore = { | ||
getEnvTypeConfigsStore: jest.fn(() => envTypesStore), | ||
load: jest.fn(), | ||
getEnvTypeConfig: jest.fn(), | ||
}; | ||
|
||
describe('ScEnvironmentCard', () => { | ||
let component = null; | ||
let wrapper = null; | ||
beforeEach(() => { | ||
// render component | ||
wrapper = shallow( | ||
<ScEnvironmentCard.WrappedComponent scEnvironment={scEnvironment} envTypesStore={envTypesStore} />, | ||
); | ||
|
||
// get instance of component | ||
component = wrapper.instance(); | ||
|
||
// mock error function because it doesn't function properly in enzyme | ||
displayErrorMock.displayError = jest.fn(x => x); | ||
}); | ||
|
||
it('should get env type configs store', async () => { | ||
// BUILD, OPERATE | ||
component.getEnvTypeConfigsStore(); | ||
|
||
// CHECK | ||
expect(envTypesStore.getEnvTypeConfigsStore).toHaveBeenCalledWith(scEnvironment.envTypeId); | ||
}); | ||
|
||
it('should get configuration', async () => { | ||
// BUILD | ||
const spyOnConfigsStore = jest.spyOn(component, 'getEnvTypeConfigsStore'); | ||
|
||
// OPERATE | ||
component.getConfiguration(scEnvironment.envTypeConfigId); | ||
|
||
// CHECK | ||
expect(spyOnConfigsStore).toHaveBeenCalled(); | ||
expect(envTypesStore.getEnvTypeConfig).toHaveBeenCalledWith(scEnvironment.envTypeConfigId); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.