github.com/argoproj/argo-cd@v1.8.7/ui/src/app/shared/components/revision.test.tsx (about) 1 import * as renderer from 'react-test-renderer'; 2 import * as React from 'react'; 3 import {isSHA, Revision} from "./revision"; 4 5 test('Revision.SHA1.Children', () => { 6 const tree = renderer.create(<Revision repoUrl='http://github.com/my-org/my-repo' revision='24eb0b24099b2e9afff72558724e88125eaa0176'>foo</Revision>).toJSON(); 7 8 expect(tree).toMatchSnapshot() 9 }); 10 11 test('Revision.SHA1.NoChildren', () => { 12 const tree = renderer.create(<Revision repoUrl='http://github.com/my-org/my-repo' revision='24eb0b24099b2e9afff72558724e88125eaa0176'/>).toJSON(); 13 14 expect(tree).toMatchSnapshot() 15 }); 16 17 test('Revision.Branch.Children', () => { 18 const tree = renderer.create(<Revision repoUrl='http://github.com/my-org/my-repo' revision='long-branch-name'>foo</Revision>).toJSON(); 19 20 expect(tree).toMatchSnapshot() 21 }); 22 23 24 test('Revision.Branch.NoChildren', () => { 25 const tree = renderer.create(<Revision repoUrl='http://github.com/my-org/my-repo' revision='long-branch-name'/>).toJSON(); 26 27 expect(tree).toMatchSnapshot() 28 }); 29 30 test('isSHA1', () => { 31 expect(isSHA('24eb0b24099b2e9afff72558724e88125eaa0176')).toBe(true); 32 expect(isSHA('master')).toBe(false); 33 });