Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/bootstrap.less
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

// Wrapper for the tooltip content
.@{tooltip-prefix-cls}-inner {
.@{tooltip-prefix-cls}-container {
padding: 8px 10px;
color: @tooltip-color;
text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion assets/bootstrap_white.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

// Wrapper for the tooltip content
.@{tooltip-prefix-cls}-inner {
.@{tooltip-prefix-cls}-container {
padding: 8px 10px;
color: @tooltip-color;
text-align: left;
Expand Down
25 changes: 25 additions & 0 deletions tests/assets.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import fs from 'fs';
import path from 'path';
import React from 'react';
import { render } from '@testing-library/react';
import Tooltip from '../src';

describe('assets', () => {
it('style the element the popup renders its content in', () => {
render(
<Tooltip overlay="Tip" visible>
<span>Target</span>
</Tooltip>,
);
const content = document.querySelector('[role="tooltip"]');

expect(content.className).toContain('rc-tooltip-container');

['bootstrap.less', 'bootstrap_white.less'].forEach((file) => {
const less = fs.readFileSync(path.join(__dirname, '..', 'assets', file), 'utf8');

expect(less).toContain('.@{tooltip-prefix-cls}-container {');
expect(less).not.toContain('.@{tooltip-prefix-cls}-inner {');
});
});
});
Loading