2022-07-05 13:21:17 +03:00
|
|
|
import {render} from '@testing-library/react';
|
2022-07-04 16:27:40 +03:00
|
|
|
import App from './App';
|
2022-07-04 16:55:30 +03:00
|
|
|
import React from 'react';
|
2023-07-27 10:09:01 +03:00
|
|
|
import nock from 'nock';
|
2022-07-04 16:27:40 +03:00
|
|
|
|
2022-07-05 11:03:56 +03:00
|
|
|
test('renders Sodo Search app component', () => {
|
2023-07-27 10:09:01 +03:00
|
|
|
nock('http://localhost:3000/ghost/api/content')
|
|
|
|
.get('/posts/?key=69010382388f9de5869ad6e558&limit=10000&fields=id%2Cslug%2Ctitle%2Cexcerpt%2Curl%2Cupdated_at%2Cvisibility&order=updated_at%20DESC')
|
|
|
|
.reply(200, {
|
|
|
|
posts: []
|
|
|
|
})
|
|
|
|
.get('/authors/?key=69010382388f9de5869ad6e558&limit=10000&fields=id,slug,name,url,profile_image&order=updated_at%20DESC')
|
|
|
|
.reply(200, {
|
|
|
|
authors: []
|
|
|
|
})
|
|
|
|
.get('/tags/?key=69010382388f9de5869ad6e558&&limit=10000&fields=id,slug,name,url&order=updated_at%20DESC&filter=visibility%3Apublic')
|
|
|
|
.reply(200, {
|
|
|
|
tags: []
|
|
|
|
});
|
|
|
|
|
2022-07-06 16:56:20 +03:00
|
|
|
window.location.hash = '#/search';
|
2023-07-27 10:09:01 +03:00
|
|
|
render(<App adminUrl="http://localhost:3000" apiKey="69010382388f9de5869ad6e558" />);
|
2022-07-05 13:21:17 +03:00
|
|
|
// const containerElement = screen.getElementsByClassName('gh-portal-popup-container');
|
|
|
|
const containerElement = document.querySelector('.gh-root-frame');
|
|
|
|
expect(containerElement).toBeInTheDocument();
|
2022-07-04 16:27:40 +03:00
|
|
|
});
|