-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
293 changed files
with
21,371 additions
and
16,073 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
src/sites | ||
src/packages/nutui.react.build.rn.ts | ||
scripts | ||
site_docs | ||
coverage | ||
|
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
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
**/*.eot | ||
package.json | ||
node_modules | ||
src/packages/nutui.react.build.rn.ts |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defineConfig } from 'cypress' | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:10086/#/', | ||
specPattern: 'cypress/e2e/**/*.js', | ||
}, | ||
viewportWidth: 414, | ||
viewportHeight: 896, | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from 'react' | ||
import { mount } from 'cypress/react18' | ||
import { ActionSheet } from '../../src/packages/actionsheet/actionsheet' | ||
|
||
const menulist = [ | ||
{ | ||
name: '选项一', | ||
description: '选项一的描述信息', | ||
danger: true, | ||
}, | ||
{ | ||
name: '选项二', | ||
disabled: true, | ||
}, | ||
{ | ||
name: '必填', | ||
name1: '选项三', | ||
}, | ||
] | ||
|
||
it('props test options ', () => { | ||
mount( | ||
<ActionSheet | ||
visible | ||
title="弹层标题" | ||
description="弹层描述信息" | ||
cancelText="关闭弹层" | ||
options={menulist} | ||
/> | ||
) | ||
cy.get('.nut-actionsheet-list .nut-actionsheet-item').should('have.length', 3) | ||
}) | ||
|
||
it('props test cancelText ', async () => { | ||
mount( | ||
<ActionSheet | ||
visible | ||
title="弹层标题" | ||
description="弹层描述信息" | ||
cancelText="关闭弹层" | ||
options={menulist} | ||
/> | ||
) | ||
cy.get('.nut-actionsheet-cancel').then(($el) => { | ||
const el = cy.wrap($el) | ||
el.should('have.text', '关闭弹层') | ||
}) | ||
}) | ||
|
||
it('props test has value ', async () => { | ||
mount( | ||
<ActionSheet | ||
visible | ||
title="弹层标题" | ||
description="弹层描述信息" | ||
cancelText="关闭弹层" | ||
options={menulist} | ||
/> | ||
) | ||
cy.get('.nut-actionsheet-list .nut-actionsheet-item') | ||
.eq(0) | ||
.then(($el) => { | ||
const el = cy.wrap($el) | ||
el.should('have.text', '选项一选项一的描述信息') | ||
el.should('have.class', 'danger') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import React from 'react' | ||
import { Button } from '../../src/packages/button/button' | ||
|
||
it('playground', () => { | ||
cy.mount(<Button type="primary">123</Button>) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react' | ||
import { Cell } from '../../src/packages/cell/cell.taro' | ||
import { Switch } from '../../src/packages/switch/switch.taro' | ||
|
||
it('prop title extra description test', () => { | ||
cy.mount( | ||
<Cell | ||
data-testid="prop" | ||
title="我是标题" | ||
description="我是描述" | ||
extra="描述文字" | ||
/> | ||
) | ||
cy.get('.nut-cell-title').should('contain.text', '我是标题') | ||
cy.get('.nut-cell-description').should('contain.text', '我是描述') | ||
cy.get('.nut-cell-extra').should('contain.text', '描述文字') | ||
}) | ||
it('prop ', () => { | ||
cy.mount(<Cell title="URL 跳转" extra="https://m.jd.com/" />) | ||
cy.get('.nut-cell-extra').should('be.visible') | ||
}) | ||
|
||
it('emit click event', () => { | ||
const testClick = () => {} | ||
cy.mount(<Cell data-testid="emit-click" onClick={() => testClick()} />) | ||
cy.get('[data-testid="emit-click"]').click().trigger('testClick') | ||
}) | ||
|
||
it('slot default test', () => { | ||
cy.mount(<Cell title={<div>自定义内容</div>} extra="描述文字" />) | ||
cy.root().should('contain.html', '<div>自定义内容</div>') | ||
}) | ||
|
||
it('slot extra', () => { | ||
cy.mount(<Cell title="Switch" extra={<Switch defaultChecked />} />) | ||
cy.get('.nut-switch').should('be.visible') | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import './taro/base.cy' | ||
import './taro/layout.cy' | ||
import './taro/nav.cy' | ||
import './taro/dentry.cy' | ||
|
||
Cypress.on('uncaught:exception', (err, runnable) => { | ||
return false | ||
}) |
Oops, something went wrong.