fix tests

This commit is contained in:
cedricve
2021-01-06 14:09:20 +01:00
parent 6b91c98a62
commit 0085c73faa
3 changed files with 14 additions and 16 deletions
-4
View File
@@ -7,10 +7,6 @@
pointer-events: none;
}
.kerberos-branding {
display: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
-3
View File
@@ -9,9 +9,6 @@ function App(props) {
<header className="App-header">
{ children }
</header>
<div className="kerberos-branding">
Kerberos Open Source
</div>
</div>
);
}
+14 -9
View File
@@ -1,11 +1,16 @@
import React from 'react';
import {
render, screen, expect, test,
} from '@testing-library/react';
import * as React from 'react';
import {render, screen} from '@testing-library/react';
import App from './App';
test('renders Kerberos Open Source text', () => {
render(<App />);
const linkElement = screen.getByText(/Kerberos Open Source/i);
expect(linkElement).toBeInTheDocument();
});
/* Test default values by rendering a context consumer without a
* matching provider
*/
test('App.jsx verify if children are rendered.', () => {
render(<App>
<div>Kerberos Open Source</div>
</App>)
expect(screen.getByText(/^Kerberos Open Source/)).toHaveTextContent(
'Kerberos Open Source',
)
})