blob: 376496aeb11ec28d26bc79a4fa76e81036484b10 [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import {expect, assert} from 'chai';
6import {ChopsDialog} from './chops-dialog.js';
7
8let element;
9
10describe('chops-dialog', () => {
11 beforeEach(() => {
12 element = document.createElement('chops-dialog');
13 document.body.appendChild(element);
14 });
15
16 afterEach(() => {
17 document.body.removeChild(element);
18 });
19
20 it('initializes', () => {
21 assert.instanceOf(element, ChopsDialog);
22 });
23
24 it('chops-dialog is visible when open', async () => {
25 element.opened = false;
26
27 await element.updateComplete;
28
29 expect(element).not.to.be.visible;
30
31 element.opened = true;
32
33 await element.updateComplete;
34
35 expect(element).to.be.visible;
36 });
37});