webpack/components/AnsibleHostDetail/AnsibleHostDetail.test.js in foreman_ansible-6.4.1 vs webpack/components/AnsibleHostDetail/AnsibleHostDetail.test.js in foreman_ansible-7.0.0

- old
+ new

@@ -1,14 +1,20 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; +import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; - import AnsibleHostDetail from './'; describe('AnsibleHostDetail', () => { - it('should show content', () => { - render(<AnsibleHostDetail />); + it('should show skeleton when loading', () => { + const { container } = render( + <AnsibleHostDetail + status="PENDING" + response={{ id: 5, name: 'test.example.com' }} + router={{}} + history={{}} + /> + ); expect( - screen.getByText('Ansible Variables coming soon!') - ).toBeInTheDocument(); + container.getElementsByClassName('react-loading-skeleton') + ).toHaveLength(5); }); });