owner_scope_test.dart 482 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import 'dart:sky';

import 'package:test/test.dart';

void main() {
  test("should return null for elements not a child of a scope", () {
    var doc = new Document();
    var element = doc.createElement("div");
    expect(element.owner, isNull);
  });
  test("should return the document for elements in the document scope", () {
    var doc = new Document();
    var element = doc.createElement("div");
    doc.appendChild(element);
    expect(element.owner, equals(doc));
  });
}