-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: truncate long app names on pull (#6741)
- Loading branch information
Showing
3 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/amplify-cli/src/__tests__/attach-backend-steps.test.ts
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,27 @@ | ||
import { analyzeProject } from '../attach-backend-steps/a20-analyzeProject'; | ||
import { $TSContext, stateManager } from 'amplify-cli-core'; | ||
|
||
jest.mock('amplify-cli-core'); | ||
const stateManager_mock = stateManager as jest.Mocked<typeof stateManager>; | ||
|
||
const contextStub = { | ||
exeInfo: { | ||
projectConfig: { | ||
projectName: 'this-is-a-possible-name-from-the-console!', | ||
version: '3.0', | ||
}, | ||
localEnvInfo: {}, | ||
}, | ||
} as $TSContext; | ||
|
||
describe('a20-analyzeProject', () => { | ||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
test('long console name', async () => { | ||
stateManager_mock.getLocalEnvInfo.mockReturnValueOnce({ defaultEditor: 'gedit' }); | ||
await analyzeProject(contextStub); | ||
expect(contextStub.exeInfo.projectConfig.projectName.length).toBe(20); | ||
}); | ||
}); |
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