From caee06593793f42b14ec746ece90118d515516fa Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Fri, 1 Nov 2019 21:05:50 -0600 Subject: [PATCH] fix(test): debug tests pass --- src/__tests__/debug.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/__tests__/debug.js b/src/__tests__/debug.js index ad3b859..aa2b2ae 100644 --- a/src/__tests__/debug.js +++ b/src/__tests__/debug.js @@ -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 = () =>

Hello World

- const {debug} = render() + angular.module('atl').component('atlHelloWorld', { + template: `

Hello World

`, + }) + const {debug} = render(``) 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: `

Hello World

Hello World

- - ) - const {getAllByTestId, debug} = render() + `, + }) + const {getAllByTestId, debug} = render(``) const multipleElements = getAllByTestId('testId') debug(multipleElements)