@@ 1,4 1,5 @@
-import React from 'react'
+import angular from 'angular'
+import 'angular-mocks'
import {render} from '../'
beforeEach(() => {
@@ 9,9 10,16 @@ afterEach(() => {
console.log.mockRestore()
})
+beforeEach(() => {
+ angular.module('atl', [])
+ angular.mock.module('atl')
+})
+
test('debug pretty prints the container', () => {
- const HelloWorld = () => <h1>Hello World</h1>
- const {debug} = render(<HelloWorld />)
+ angular.module('atl').component('atlHelloWorld', {
+ template: `<h1>Hello World</h1>`,
+ })
+ const {debug} = render(`<atl-hello-world></atl-hello-world>`)
debug()
expect(console.log).toHaveBeenCalledTimes(1)
expect(console.log).toHaveBeenCalledWith(
@@ 20,13 28,13 @@ test('debug pretty prints the container', () => {
})
test('debug pretty prints multiple containers', () => {
- const HelloWorld = () => (
- <>
+ angular.module('atl').component('atlHelloWorld', {
+ template: `
<h1 data-testid="testId">Hello World</h1>
<h1 data-testid="testId">Hello World</h1>
- </>
- )
- const {getAllByTestId, debug} = render(<HelloWorld />)
+ `,
+ })
+ const {getAllByTestId, debug} = render(`<atl-hello-world></atl-hello-world>`)
const multipleElements = getAllByTestId('testId')
debug(multipleElements)