-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Unable to query the mounted element from document while it is accessible from $rootElement.
How to reproduce?
import angular from 'angular';
import { mount } from 'cypress-angularjs-unit-test';
it('should find the element from document', (done) => {
const module = angular.module('app', []);
module.run(($timeout, $rootElement) => {
console.log($rootElement[0].querySelector('.target')); // <div class="target"></div>
console.log(document.querySelector('.target')); // null
$timeout(() => {
console.log($rootElement[0].querySelector('.target')); // <div class="target"></div>
console.log(document.querySelector('.target')); // null
done();
});
});
mount('<div class="target"></div>', ['app']);
console.log(document.querySelector('.target')); // null
});Expected behavior
Should able to access the mounted element from document.
Metadata
Metadata
Assignees
Labels
No labels