-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prettier --write packages/quark/src/**/*.test.js
- Loading branch information
Showing
44 changed files
with
1,188 additions
and
1,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,41 @@ | ||
import { expect, fixture } from '@open-wc/testing'; | ||
import '../../../lib/cell'; | ||
import { expect, fixture } from "@open-wc/testing"; | ||
import "../../../lib/cell"; | ||
|
||
const data = { | ||
title: '标题', | ||
desc : '描述', | ||
to : '#/button' | ||
} | ||
title: "标题", | ||
desc: "描述", | ||
to: "#/button", | ||
}; | ||
let el; | ||
|
||
describe('<quark-cell>', async () => { | ||
it('to attribute', async () => { | ||
describe("<quark-cell>", async () => { | ||
it("to attribute", async () => { | ||
el = await fixture( | ||
`<quark-cell | ||
`<quark-cell | ||
to=${data.to} | ||
> | ||
</quark-cell>`); | ||
</quark-cell>` | ||
); | ||
expect(el.to).to.be.equal(data.to); | ||
}); | ||
|
||
|
||
it('title attribute', async () => { | ||
it("title attribute", async () => { | ||
el = await fixture( | ||
`<quark-cell title=${data.title}> | ||
</quark-cell>`); | ||
const titleE = el.shadowRoot.querySelector('.title'); | ||
`<quark-cell title=${data.title}> | ||
</quark-cell>` | ||
); | ||
const titleE = el.shadowRoot.querySelector(".title"); | ||
expect(titleE.innerHTML).to.equal(data.title); | ||
expect(el.title).to.equal(data.title); | ||
}); | ||
|
||
it('desc attribute', async () => { | ||
it("desc attribute", async () => { | ||
el = await fixture( | ||
`<quark-cell desc=${data.desc}> | ||
</quark-cell>`); | ||
const descE = el.shadowRoot.querySelector('.desc'); | ||
`<quark-cell desc=${data.desc}> | ||
</quark-cell>` | ||
); | ||
const descE = el.shadowRoot.querySelector(".desc"); | ||
expect(descE.innerHTML).to.equal(data.desc); | ||
expect(el.desc).to.equal(data.desc); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,55 @@ | ||
import { expect, fixture, html } from '@open-wc/testing'; | ||
import sinon from 'sinon'; | ||
import '../../../lib/checkbox'; | ||
import { expect, fixture, html } from "@open-wc/testing"; | ||
import sinon from "sinon"; | ||
import "../../../lib/checkbox"; | ||
const data = { | ||
disabled: 'true', | ||
shape: 'square', | ||
size : 'big', | ||
disabled: "true", | ||
shape: "square", | ||
size: "big", | ||
checked: true, | ||
} | ||
}; | ||
let el; | ||
describe('quark-checkbox', async () => { | ||
describe("quark-checkbox", async () => { | ||
before(async () => { | ||
el = await fixture( | ||
`<quark-checkbox | ||
`<quark-checkbox | ||
disabled=${data.disabled} | ||
shape=${data.shape} | ||
size=${data.size} | ||
checked=${data.checked} | ||
> | ||
</quark-checkbox>`); | ||
</quark-checkbox>` | ||
); | ||
}); | ||
|
||
it('checkbox exist', async () => { | ||
const badge = el.shadowRoot.querySelector('.quark-checkbox-wrapper'); | ||
it("checkbox exist", async () => { | ||
const badge = el.shadowRoot.querySelector(".quark-checkbox-wrapper"); | ||
expect(badge).to.exist; | ||
}); | ||
|
||
it('disabled attribute', () => { | ||
it("disabled attribute", () => { | ||
expect(el.type).to.equal(data.type); | ||
}); | ||
|
||
it('shape attribute', () => { | ||
it("shape attribute", () => { | ||
expect(el.content).to.equal(data.content); | ||
}); | ||
|
||
it('size attribute', () => { | ||
it("size attribute", () => { | ||
expect(el.size).to.equal(data.size); | ||
}); | ||
|
||
it('checked attribute', () => { | ||
it("checked attribute", () => { | ||
expect(el.checked).to.equal(data.checked); | ||
}); | ||
|
||
it('click Event', async() => { | ||
it("click Event", async () => { | ||
const node = await fixture( | ||
`<quark-checkbox :checked="false">方形</quark-checkbox>` | ||
); | ||
const eventspy = sinon.spy(); | ||
node.addEventListener('change', eventspy); | ||
const checkbox = node.shadowRoot.querySelector('.quark-checkbox-wrapper'); | ||
checkbox.dispatchEvent(new Event('click')); | ||
expect(eventspy.called).to.equal(true); | ||
node.addEventListener("change", eventspy); | ||
const checkbox = node.shadowRoot.querySelector(".quark-checkbox-wrapper"); | ||
checkbox.dispatchEvent(new Event("click")); | ||
expect(eventspy.called).to.equal(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import { expect, fixture } from '@open-wc/testing'; | ||
import '../../../lib/datetime-picker'; | ||
import { expect, fixture } from "@open-wc/testing"; | ||
import "../../../lib/datetime-picker"; | ||
|
||
const data = { | ||
title: '请选择时间', | ||
title: "请选择时间", | ||
open: true, | ||
bottomhidden : true, | ||
} | ||
bottomhidden: true, | ||
}; | ||
let el; | ||
|
||
describe('<quark-datetime-picker>', async () => { | ||
|
||
it('element exist', async () => { | ||
el = await fixture( | ||
`<quark-datetime-picker | ||
describe("<quark-datetime-picker>", async () => { | ||
it("element exist", async () => { | ||
el = await fixture( | ||
`<quark-datetime-picker | ||
title=${data.title} | ||
open=${data.open} | ||
> | ||
</quark-datetime-picker>`); | ||
const container = el.shadowRoot.querySelector('.picker-container'); | ||
const header = el.shadowRoot.querySelector('.picker-header'); | ||
const headerTitle = el.shadowRoot.querySelector('.header-title'); | ||
const content = el.shadowRoot.querySelector('.picker-content'); | ||
const bottom = el.shadowRoot.querySelector('.picker-bottom'); | ||
expect(container).to.exist; | ||
expect(header).to.exist; | ||
expect(headerTitle).to.exist; | ||
expect(content).to.exist; | ||
expect(bottom).to.exist; | ||
</quark-datetime-picker>` | ||
); | ||
const container = el.shadowRoot.querySelector(".picker-container"); | ||
const header = el.shadowRoot.querySelector(".picker-header"); | ||
const headerTitle = el.shadowRoot.querySelector(".header-title"); | ||
const content = el.shadowRoot.querySelector(".picker-content"); | ||
const bottom = el.shadowRoot.querySelector(".picker-bottom"); | ||
expect(container).to.exist; | ||
expect(header).to.exist; | ||
expect(headerTitle).to.exist; | ||
expect(content).to.exist; | ||
expect(bottom).to.exist; | ||
}); | ||
}); |
Oops, something went wrong.