mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Add integration test for Board component
This commit is contained in:
@@ -85,7 +85,7 @@ class NewPost extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
try {
|
||||
let res = await fetch('http://localhost:3000/posts', {
|
||||
let res = await fetch('/posts', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
@@ -139,7 +139,7 @@ class NewPost extends React.Component<Props, State> {
|
||||
{ showForm ? 'Cancel' : 'Submit feedback' }
|
||||
</button>
|
||||
:
|
||||
<a href="http://localhost:3000/users/sign_in" className="btn btn-dark">
|
||||
<a href="/users/sign_in" className="btn btn-dark">
|
||||
Log in / Sign up
|
||||
</a>
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ const PostStatusListItem = ({
|
||||
isCurrentFilter,
|
||||
handleResetFilter,
|
||||
}: Props) => (
|
||||
<div className="postStatusListItemContainer">
|
||||
<div className={"postStatusListItemContainer " + `postStatus${name.replace(/ /g, '')}`}>
|
||||
<a onClick={handleClick} className="postStatusListItemLink">
|
||||
<div className="postStatusListItem">
|
||||
<div className="dot" style={{backgroundColor: color}}></div>
|
||||
|
||||
@@ -74,7 +74,7 @@ class Board extends React.Component<Props, State> {
|
||||
if (byPostStatus) params += `&post_status_id=${byPostStatus}`;
|
||||
|
||||
try {
|
||||
let res = await fetch(`http://localhost:3000/posts?board_id=${boardId}${params}`);
|
||||
let res = await fetch(`/posts?board_id=${boardId}${params}`);
|
||||
let data = await res.json();
|
||||
|
||||
this.setState({
|
||||
@@ -110,7 +110,7 @@ class Board extends React.Component<Props, State> {
|
||||
});
|
||||
|
||||
try {
|
||||
let res = await fetch('http://localhost:3000/post_statuses');
|
||||
let res = await fetch('/post_statuses');
|
||||
let data = await res.json();
|
||||
|
||||
this.setState({
|
||||
|
||||
Reference in New Issue
Block a user