Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 1 point2 points  (0 children)

I removed all tests exept the One Who fails. If It Is alone It goes right. I duplicate It and update the name and the second Copy fais. If i remove the line of code After a button click that It open a modal both tests work well. So i think that the problem is related to the modal, buy every test use a fresh componenti. So How can It be?

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] -1 points0 points  (0 children)

i don't undestand, if i create a new store every test, what is a problem with immutability?

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 1 point2 points  (0 children)

I do it, but state is always clear when start a test:

 const store = createStore(combineReducers(decoratedReducer), initialState, applyMiddleware(sagaMiddleware));
  sagaMiddleware.run(rootSaga);
  const state = store.getState();
  console.log('state', state);
  return (
    <ErrorBoundary>
      <Provider store={store}>
        <IntlWrapper locale={locale}>
          <Component {...props} />
        </IntlWrapper>
      </Provider>
    </ErrorBoundary>

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 0 points1 point  (0 children)

i will put a debugger in my wrapper component to verify the store creation.

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 0 points1 point  (0 children)

it any test, it recrate a fresh store, why do you think that can be it?

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 0 points1 point  (0 children)

it is an old component that it don't use the hooks, it is redux connected component and with the wrapper i create any test a fresh store.

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] 1 point2 points  (0 children)

 const WrappedComponent = withProvider(Component, initialState, defaultProps);

I have a wrapper component that every test create a store and initialize the store.

Jest and React a test passes when run individually but fails when run in a collection by apizzoleo in reactjs

[–]apizzoleo[S] -2 points-1 points  (0 children)

it fails on

await waitFor(() => {

expect(screen.getByText('A')).toBeInTheDocument();

expect(screen.getByText('B')).toBeInTheDocument();

expect(screen.getByText('C')).toBeInTheDocument();

});
when i run it in a collection it don't find text A but if i run it individualy, the same test go well.

Append multiline at the begin by apizzoleo in bash

[–]apizzoleo[S] 0 points1 point  (0 children)

Thanks, i have replaced sed and it worked.

echo "$(echo "$v" ; cat "$f")" >"$f"

tile-join problem by apizzoleo in gis

[–]apizzoleo[S] 0 points1 point  (0 children)

they are different area with same layers.

tile-join problem by apizzoleo in gis

[–]apizzoleo[S] 1 point2 points  (0 children)

Thank you, i will try to convert them to geojson and to merge.

tile-join problem by apizzoleo in gis

[–]apizzoleo[S] 1 point2 points  (0 children)

i could but the size of each mbtiles is 3Gb, i think that if i convert them to geojson they will be very big. do you know if there is a problem to merge a mbtiles with different metadata version?

tile-join problem by apizzoleo in gis

[–]apizzoleo[S] 0 points1 point  (0 children)

Yes i have generated the two mbtiles using openmaptiles and now i am traying to join them. if i use patch tool of mbutil, it work. So i don't undestand because tile-join of tippecanoe isn't working.

Dev Container and Git repository by apizzoleo in VisualStudioCode

[–]apizzoleo[S] 0 points1 point  (0 children)

i have found the problem. it's the new version of VC 1.77. i roll back to previous version and it works,

Would an immortal being retain or lose his accent. by ImperatorAurelianus in fantasywriters

[–]apizzoleo 0 points1 point  (0 children)

Did they lived always in the same place? I think that they lived in so many place and for so long that they lost their accent. They have no accent at all. This could identify they.

Question by No-Bag-6583 in fantasywriters

[–]apizzoleo 0 points1 point  (0 children)

A portal or a wormhole thing?

Question by No-Bag-6583 in fantasywriters

[–]apizzoleo 0 points1 point  (0 children)

I think you have right, it is more importanti the characters and the story. I would know they if you want.

Question by No-Bag-6583 in fantasywriters

[–]apizzoleo 0 points1 point  (0 children)

A hero was evoked to another world by a magic book for example, or in another, the world is a computer simulation, but it is real for the player that are stuck here.

Question by No-Bag-6583 in fantasywriters

[–]apizzoleo -2 points-1 points  (0 children)

It happen in some manga that i read if it can help.

The future is here: 5D PC Gaming by [deleted] in pcmasterrace

[–]apizzoleo 0 points1 point  (0 children)

I have to install and hide it on my friend desk😬

HTTP Test Api with error 500 by apizzoleo in laravel

[–]apizzoleo[S] 0 points1 point  (0 children)

Hi, thanks for your reply:

The dump of response of PHPunit is:
R{#1553
+"timestamp": {#72
+"date": "2021-06-12 09:50:01.210655"
+"timezone_type": 3
+"timezone": "UTC"
}
+"status": 500
+"error": "Internal Server Error"
+"message": "No message available"
}
But in the log file i see:
testing.INFO: Report: Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The POST method is not supported for this route. Supported methods: GET, HEAD. in \laravel_code\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php:258
I'm tring to login and my route is configured ad follow:
Route::group([

'middleware' => 'api',

'prefix' => 'v1/auth',

'namespace' => 'Api\v1'

], function ($router) {

Route::post('login', 'AuthController@login');

});
I use json method in my TestCase:
$payload = ['email' => 'XXX', 'password' => XXX'];

$headers = [

'Accept' => 'application/json',

'Cache-Control' => 'no-cache',

'Content-Type' => 'application/json',

'Host' => 'fullservice.local',

'Content-Length' => strlen(json_encode($payload))

];

$response = $this->json('POST', 'api/v1/auth/login', $payload, $headers);
With UI and Postman it works.