-
Notifications
You must be signed in to change notification settings - Fork 820
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(amplify-util-uibuilder): remove codegen-ui usage
- Loading branch information
Justin Shih
committed
Sep 27, 2023
1 parent
d87adc8
commit f79a767
Showing
14 changed files
with
4,815 additions
and
134 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
37 changes: 37 additions & 0 deletions
37
packages/amplify-util-uibuilder/src/__tests__/codegen-ui-dependency-provider.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,37 @@ | ||
import semver from 'semver'; | ||
import { ReactRequiredDependencyProvider } from '../commands/utils/codegen-ui-dependency-provider'; | ||
|
||
describe('ReactStudioDependencyProvider', () => { | ||
const requiredDependencies = new ReactRequiredDependencyProvider().getRequiredDependencies(false); | ||
const requiredDependenciesWithStorageManager = new ReactRequiredDependencyProvider().getRequiredDependencies(true); | ||
|
||
describe('getRequiredDependencies', () => { | ||
it('has required dependencies', () => { | ||
expect(requiredDependencies.length).toBeGreaterThan(0); | ||
}); | ||
|
||
it('includes ui-react', () => { | ||
expect(requiredDependencies.filter((dep) => dep.dependencyName === '@aws-amplify/ui-react')).toBeTruthy(); | ||
}); | ||
|
||
it('includes all valid semver values', () => { | ||
requiredDependencies.forEach((dep) => { | ||
expect(semver.valid(dep.supportedSemVerPattern)).toBeDefined(); | ||
}); | ||
}); | ||
|
||
it('includes reasons on all dependencies', () => { | ||
requiredDependencies.forEach((dep) => { | ||
expect(dep.reason.length).toBeGreaterThan(0); | ||
}); | ||
}); | ||
|
||
it('does not include ui-react-storage if user does not use StorageManager', () => { | ||
expect(requiredDependencies.filter((dep) => dep.dependencyName !== '@aws-amplify/ui-react-storage')).toBeTruthy(); | ||
}); | ||
|
||
it('includes ui-react-storage if user is using StorageManager', () => { | ||
expect(requiredDependenciesWithStorageManager.filter((dep) => dep.dependencyName === '@aws-amplify/ui-react-storage')).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.