Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #471 from ZbayApp/feature/add-restart-app-modals-t…
Browse files Browse the repository at this point in the history
…est-cases

Feature/add restart app modals test cases
  • Loading branch information
Dinek007 authored Dec 2, 2021
2 parents b8f2aa7 + 880f42a commit f463374
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"@types/ps-node": "^0.1.0",
"@types/redux-debounced": "^0.2.19",
"@zbayapp/identity": "^3.3.3",
"@zbayapp/nectar": "^1.19.1",
"@zbayapp/nectar": "^1.19.2",
"asn1js": "^2.1.1",
"async": "^3.1.0",
"atob": "^2.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const JoinCommunity = () => {
const loadingStartApp = useModal(ModalName.loadingPanel)

useEffect(() => {
if (!community && !loadingStartApp.open && !isConnected) {
if (!loadingStartApp.open && !isConnected) {
loadingStartApp.handleOpen({
message: LoadingMessages.StartApp
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import MockedSocket from 'socket.io-mock'
import { ioMock } from '../../../../shared/setupTests'
import { communitiesActions } from '@zbayapp/nectar/lib/sagas/communities/communities.slice'
import { identityActions } from '@zbayapp/nectar/lib/sagas/identity/identity.slice'
import { LoadingMessages } from './loadingMessages'

describe('Restart app works correctly', () => {
let socket: MockedSocket
Expand All @@ -32,7 +33,7 @@ describe('Restart app works correctly', () => {
{
[StoreKeys.Socket]: {
...new SocketState(),
isConnected: true
isConnected: false
}
},
socket // Fork Nectar's sagas
Expand Down Expand Up @@ -67,8 +68,16 @@ describe('Restart app works correctly', () => {
const createDictionary = CreateCommunityDictionary()
const createCommunityTitle = screen.queryByText(createDictionary.header)

const createCommunityLoadingText = screen.queryByText(LoadingMessages.CreateCommunity)
const joinCommunityLoadingText = screen.queryByText(LoadingMessages.JoinCommunity)
const startAppLoadingText = screen.queryByText(LoadingMessages.StartApp)

expect(channelName).toBeVisible()

expect(joinCommunityTitle).toBeNull()
expect(createCommunityTitle).toBeNull()
expect(createCommunityLoadingText).toBeNull()
expect(joinCommunityLoadingText).toBeNull()
expect(startAppLoadingText).toBeNull()
})
})

0 comments on commit f463374

Please sign in to comment.