mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
4 years ago
|
import React from 'react';
|
||
|
import { mount } from '@cypress/react';
|
||
|
import { Button } from 'antd';
|
||
|
import { TestWrapper } from './utils/TestWrapper';
|
||
|
|
||
|
describe('antd dark', () => {
|
||
|
it('antd button', () => {
|
||
|
mount(
|
||
|
<TestWrapper>
|
||
|
<Button data-testid="default">默认</Button>
|
||
|
<Button type="primary" data-testid="primary">
|
||
|
主色
|
||
|
</Button>
|
||
|
<Button danger={true} type="primary" data-testid="primary-danger">
|
||
|
主危险
|
||
|
</Button>
|
||
|
</TestWrapper>
|
||
|
);
|
||
|
|
||
|
cy.get('[data-testid=default]')
|
||
|
.should('have.css', 'color', 'rgba(255, 255, 255, 0.65)')
|
||
|
.should('have.css', 'border-color', 'rgb(67, 67, 67)')
|
||
|
.should('have.css', 'background-color', 'rgba(0, 0, 0, 0)')
|
||
|
.matchImageSnapshot();
|
||
|
|
||
|
cy.get('[data-testid=primary]')
|
||
|
.should('have.css', 'color', 'rgb(255, 255, 255)')
|
||
|
.should('have.css', 'border-color', 'rgb(23, 125, 220)')
|
||
|
.should('have.css', 'background-color', 'rgb(23, 125, 220)');
|
||
|
|
||
|
cy.get('[data-testid=primary-danger]')
|
||
|
.should('have.css', 'color', 'rgb(255, 255, 255)')
|
||
|
.should('have.css', 'border-color', 'rgb(166, 29, 36)')
|
||
|
.should('have.css', 'background-color', 'rgb(166, 29, 36)');
|
||
|
});
|
||
|
});
|