* fix(deps): omit ipfs-core * fix(deps): use @svgr/plugin-svgo/nth-check@2.0.1 * fix(deps): use resolve-url-loader/postcss@8.4.31 * chore(deps): rebuild package-lock.json * chore(actions): update actions
This commit is contained in:
parent
b9b452167b
commit
54f7b2dd93
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -10,8 +10,8 @@ jobs:
|
|||||||
test_and_build:
|
test_and_build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.1
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -12,10 +12,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
62714
package-lock.json
generated
62714
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -26,6 +26,7 @@
|
|||||||
"idb-chunk-store": "^1.0.1",
|
"idb-chunk-store": "^1.0.1",
|
||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"mui-markdown": "^0.5.5",
|
"mui-markdown": "^0.5.5",
|
||||||
|
"querystring": "^0.2.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-git-info": "^2.0.1",
|
"react-git-info": "^2.0.1",
|
||||||
@ -87,6 +88,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
||||||
"@types/react-syntax-highlighter": "^15.5.5",
|
"@types/react-syntax-highlighter": "^15.5.5",
|
||||||
"@types/streamsaver": "^2.0.1",
|
"@types/streamsaver": "^2.0.1",
|
||||||
"@types/uuid": "^8.3.4",
|
"@types/uuid": "^8.3.4",
|
||||||
@ -116,6 +118,15 @@
|
|||||||
"url": "^0.11.0",
|
"url": "^0.11.0",
|
||||||
"util": "^0.12.5"
|
"util": "^0.12.5"
|
||||||
},
|
},
|
||||||
|
"overrides": {
|
||||||
|
"ipfs-core": "npm:dry-uninstall",
|
||||||
|
"@svgr/plugin-svgo": {
|
||||||
|
"nth-check": "2.0.1"
|
||||||
|
},
|
||||||
|
"resolve-url-loader": {
|
||||||
|
"postcss": "8.4.31"
|
||||||
|
}
|
||||||
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"transformIgnorePatterns": [
|
"transformIgnorePatterns": [
|
||||||
"node_modules/(?!trystero)/"
|
"node_modules/(?!trystero)/"
|
||||||
|
10
sdk/sdk.ts
10
sdk/sdk.ts
@ -23,7 +23,7 @@ const iframeAttributes = [
|
|||||||
const configRequestTimeout = 10_000
|
const configRequestTimeout = 10_000
|
||||||
|
|
||||||
class ChatEmbed extends HTMLElement {
|
class ChatEmbed extends HTMLElement {
|
||||||
private configRequestExpirationTimer: NodeJS.Timer | null = null
|
private configRequestExpirationTimout: NodeJS.Timeout | null = null
|
||||||
|
|
||||||
private iframe = document.createElement('iframe')
|
private iframe = document.createElement('iframe')
|
||||||
|
|
||||||
@ -90,9 +90,9 @@ class ChatEmbed extends HTMLElement {
|
|||||||
private stopListeningForConfigRequest = () => {
|
private stopListeningForConfigRequest = () => {
|
||||||
window.removeEventListener('message', this.handleConfigRequestedMessage)
|
window.removeEventListener('message', this.handleConfigRequestedMessage)
|
||||||
|
|
||||||
if (this.configRequestExpirationTimer !== null) {
|
if (this.configRequestExpirationTimout !== null) {
|
||||||
clearInterval(this.configRequestExpirationTimer)
|
clearInterval(this.configRequestExpirationTimout)
|
||||||
this.configRequestExpirationTimer = null
|
this.configRequestExpirationTimout = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ class ChatEmbed extends HTMLElement {
|
|||||||
|
|
||||||
window.addEventListener('message', this.handleConfigRequestedMessage)
|
window.addEventListener('message', this.handleConfigRequestedMessage)
|
||||||
|
|
||||||
this.configRequestExpirationTimer = setTimeout(() => {
|
this.configRequestExpirationTimout = setTimeout(() => {
|
||||||
console.error(`[chitchatter-sdk] configuration was not sent successfully`)
|
console.error(`[chitchatter-sdk] configuration was not sent successfully`)
|
||||||
this.stopListeningForConfigRequest()
|
this.stopListeningForConfigRequest()
|
||||||
}, configRequestTimeout)
|
}, configRequestTimeout)
|
||||||
|
@ -43,15 +43,15 @@ const getConfigFromSdk = () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return new Promise<Partial<UserSettings>>((resolve, reject) => {
|
return new Promise<Partial<UserSettings>>((resolve, reject) => {
|
||||||
let expireTimer: NodeJS.Timer
|
let expireTimout: NodeJS.Timeout
|
||||||
|
|
||||||
const expireListener = () => {
|
const expireListener = () => {
|
||||||
window.removeEventListener('message', handleMessage)
|
window.removeEventListener('message', handleMessage)
|
||||||
clearTimeout(expireTimer)
|
clearTimeout(expireTimout)
|
||||||
reject()
|
reject()
|
||||||
}
|
}
|
||||||
|
|
||||||
expireTimer = setTimeout(expireListener, configListenerTimeout)
|
expireTimout = setTimeout(expireListener, configListenerTimeout)
|
||||||
|
|
||||||
const handleMessage = (event: MessageEvent) => {
|
const handleMessage = (event: MessageEvent) => {
|
||||||
if (!isConfigMessageEvent(event)) return
|
if (!isConfigMessageEvent(event)) return
|
||||||
|
@ -74,7 +74,7 @@ describe('Room', () => {
|
|||||||
expect(sendButton).toBeDisabled()
|
expect(sendButton).toBeDisabled()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('inputting text enabled send button', () => {
|
test('inputting text enabled send button', async () => {
|
||||||
render(
|
render(
|
||||||
<RouteStub>
|
<RouteStub>
|
||||||
<Room userId={mockUserId} roomId={mockRoomId} />
|
<Room userId={mockUserId} roomId={mockRoomId} />
|
||||||
@ -83,7 +83,11 @@ describe('Room', () => {
|
|||||||
|
|
||||||
const sendButton = screen.getByLabelText('Send')
|
const sendButton = screen.getByLabelText('Send')
|
||||||
const textInput = screen.getByPlaceholderText('Your message')
|
const textInput = screen.getByPlaceholderText('Your message')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.type(textInput, 'hello')
|
userEvent.type(textInput, 'hello')
|
||||||
|
})
|
||||||
|
|
||||||
expect(sendButton).not.toBeDisabled()
|
expect(sendButton).not.toBeDisabled()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -96,7 +100,10 @@ describe('Room', () => {
|
|||||||
|
|
||||||
const sendButton = screen.getByLabelText('Send')
|
const sendButton = screen.getByLabelText('Send')
|
||||||
const textInput = screen.getByPlaceholderText('Your message')
|
const textInput = screen.getByPlaceholderText('Your message')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.type(textInput, 'hello')
|
userEvent.type(textInput, 'hello')
|
||||||
|
})
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
userEvent.click(sendButton)
|
userEvent.click(sendButton)
|
||||||
@ -118,7 +125,10 @@ describe('Room', () => {
|
|||||||
|
|
||||||
const sendButton = screen.getByLabelText('Send')
|
const sendButton = screen.getByLabelText('Send')
|
||||||
const textInput = screen.getByPlaceholderText('Your message')
|
const textInput = screen.getByPlaceholderText('Your message')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.type(textInput, 'hello')
|
userEvent.type(textInput, 'hello')
|
||||||
|
})
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
userEvent.click(sendButton)
|
userEvent.click(sendButton)
|
||||||
|
@ -79,7 +79,7 @@ export const Drawer = ({ isDrawerOpen, onDrawerClose, theme }: DrawerProps) => {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Box>
|
</Box>
|
||||||
<Divider />
|
<Divider />
|
||||||
<List role="navigation">
|
<List role="navigation" aria-label="Navigation menu">
|
||||||
<Link to={routes.ROOT}>
|
<Link to={routes.ROOT}>
|
||||||
<ListItem disablePadding>
|
<ListItem disablePadding>
|
||||||
<ListItemButton>
|
<ListItemButton>
|
||||||
|
@ -28,20 +28,34 @@ const ShellStub = (shellProps: Partial<ShellProps> = {}) => {
|
|||||||
|
|
||||||
describe('Shell', () => {
|
describe('Shell', () => {
|
||||||
describe('menu drawer', () => {
|
describe('menu drawer', () => {
|
||||||
test('can be opened', () => {
|
test('can be opened', async () => {
|
||||||
render(<ShellStub />)
|
render(<ShellStub />)
|
||||||
const menuButton = screen.getByLabelText('Open menu')
|
const menuButton = screen.getByLabelText('Open menu')
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.click(menuButton)
|
userEvent.click(menuButton)
|
||||||
|
})
|
||||||
|
|
||||||
const navigation = screen.getByRole('navigation')
|
const navigation = screen.getByRole('navigation')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
expect(navigation).toBeVisible()
|
expect(navigation).toBeVisible()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
test('can be closed', async () => {
|
test('can be closed', async () => {
|
||||||
render(<ShellStub />)
|
render(<ShellStub />)
|
||||||
const menuButton = screen.getByLabelText('Open menu')
|
const menuButton = screen.getByLabelText('Open menu')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.click(menuButton)
|
userEvent.click(menuButton)
|
||||||
|
})
|
||||||
|
|
||||||
const closeMenu = screen.getByLabelText('Close menu')
|
const closeMenu = screen.getByLabelText('Close menu')
|
||||||
|
|
||||||
|
await waitFor(() => {
|
||||||
userEvent.click(closeMenu)
|
userEvent.click(closeMenu)
|
||||||
|
})
|
||||||
|
|
||||||
const navigation = screen.getByRole('navigation')
|
const navigation = screen.getByRole('navigation')
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user