|
| 1 | +/** |
| 2 | + * MIT No Attribution |
| 3 | + * |
| 4 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 7 | + * the Software without restriction, including without limitation the rights to |
| 8 | + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 9 | + * the Software, and to permit persons to whom the Software is furnished to do so. |
| 10 | + * |
| 11 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 12 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 14 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 15 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 16 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 17 | + * SOFTWARE. |
| 18 | + */ |
| 19 | + |
| 20 | +import { getRequiredBootstrapPolicies } from '../../src/bootstrap/required-policies'; |
| 21 | + |
| 22 | +describe('getRequiredBootstrapPolicies', () => { |
| 23 | + it('returns core policies plus compute-agentcore for default', () => { |
| 24 | + const result = getRequiredBootstrapPolicies('agentcore'); |
| 25 | + expect(result).toEqual(['infrastructure', 'application', 'observability', 'compute-agentcore']); |
| 26 | + }); |
| 27 | + |
| 28 | + it('includes compute-ecs when compute type is ecs', () => { |
| 29 | + const result = getRequiredBootstrapPolicies('ecs'); |
| 30 | + expect(result).toContain('compute-ecs'); |
| 31 | + expect(result).toContain('compute-agentcore'); |
| 32 | + }); |
| 33 | + |
| 34 | + it('always includes compute-agentcore regardless of type', () => { |
| 35 | + const result = getRequiredBootstrapPolicies('ecs'); |
| 36 | + expect(result).toContain('compute-agentcore'); |
| 37 | + }); |
| 38 | + |
| 39 | + it('returns core policies for unknown compute type', () => { |
| 40 | + const result = getRequiredBootstrapPolicies('unknown'); |
| 41 | + expect(result).toEqual(['infrastructure', 'application', 'observability', 'compute-agentcore']); |
| 42 | + expect(result).not.toContain('compute-ecs'); |
| 43 | + }); |
| 44 | +}); |
0 commit comments