Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): remove warnings #6335

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/editor-sharded-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/6120ac5cd201f6cb593d1b80e861be0342495be9.tar.gz
- name: Run the Karma tests
if: steps.cache-editor-tests.outputs.cache-hit != 'true'
run: nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run check-editor-karma-ci-shard-${{ inputs.shard_number }}
run: nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --quiet --run check-editor-karma-ci-shard-${{ inputs.shard_number }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jest/expect-expect */
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import {
BakedInStoryboardVariableName,
BakedInStoryboardUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import {
SafeGapSmallElementSize,
SmallElementSize,
} from '../../controls/bounding-box-hooks'
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import { ComponentsHonouringPropsStylesProject } from './common-projects.test-utils'
import { SizeLabelTestId } from '../../controls/select-mode/size-label'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import { getDomRectCenter } from '../../../core/shared/dom-utils'
import * as EP from '../../../core/shared/element-path'
import { createModifiedProject } from '../../../sample-projects/sample-project-utils.test-utils'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable jest/expect-expect */
import * as MockReactThreeFiber from '@react-three/fiber'
import * as mockWithEditorPackageJSON from '../../../../package.json'
import mockWithEditorPackageJSON from '../../../../package.json'

import { DefaultStartingFeatureSwitches, renderTestEditorWithModel } from '../ui-jsx.test-utils'
import type { ParsedTextFile } from '../../../core/shared/project-file-types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async function dispatchActionsAndWaitUntilComplete(
actionsToDispatch: readonly EditorAction[],
renderResult: EditorRenderResult,
): Promise<void> {
//
await act(() => renderResult.dispatch(actionsToDispatch, false))
await renderResult.getDispatchFollowUpActionsFinished()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import * as EP from '../../../core/shared/element-path'
import type { ElementPath } from '../../../core/shared/project-file-types'
import { fireEvent } from '@testing-library/react'
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import {
clearExpressionUniqueIDs,
emptyComments,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fireEvent, screen } from '@testing-library/react'
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import type { EditorRenderResult } from '../../components/canvas/ui-jsx.test-utils'
import {
TestSceneUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { fireEvent, waitFor } from '@testing-library/react'
import { labelTestIdForComponentIcon } from './component-picker-context-menu'
import { ReplaceElementButtonTestId, addChildButtonTestId } from './navigator-item-components'
import { NavigatorContainerId } from '../navigator'
import { act } from 'react-dom/test-utils'
import { act } from '@testing-library/react'
import { cmdModifier } from '../../../utils/modifiers'
import { getNavigatorTargetsFromEditorState } from '../navigator-utils'

Expand Down
4 changes: 2 additions & 2 deletions editor/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const config = {
'REACT_APP_ENVIRONMENT_CONFIG',
'REACT_APP_AUTH0_CLIENT_ID',
'REACT_APP_AUTH0_ENDPOINT',
'REACT_APP_COMMIT_HASH',

// !! optional env vars should be added in the webpack.EnvironmentPlugin below providing a default value for them instead than here
]),
Expand All @@ -171,6 +170,7 @@ const config = {
GOOGLE_WEB_FONTS_KEY: '', // providing an empty default for GOOGLE_WEB_FONTS_KEY for now
REACT_APP_BROWSER_TEST_DEBUG: 'false',
USE_BFF: 'false',
REACT_APP_COMMIT_HASH: undefined,
}),

new webpack.ProvidePlugin({ BrowserFS: 'browserfs' }), // weirdly, the browserfs/dist/shims/fs shim assumes a global BrowserFS being available
Expand Down Expand Up @@ -336,7 +336,7 @@ const config = {
}),
]
: [],
moduleIds: 'hashed', // "Short hashes as ids for better long term caching."
moduleIds: 'deterministic', // "Short numeric ids which will not be changing between compilation. Good for long term caching."
splitChunks: {
chunks: 'all',
},
Expand Down
10 changes: 5 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ let
#!/usr/bin/env bash
set -e
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/utopia-api
${pnpm}/bin/pnpm install
${pnpm}/bin/pnpm install --silent
${pnpm}/bin/pnpm run build
'')
(pkgs.writeScriptBin "install-eslint-config-utopia" ''
#!/usr/bin/env bash
set -e
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/eslint-config-utopia
${pnpm}/bin/pnpm install
${pnpm}/bin/pnpm install --silent
'')
(pkgs.writeScriptBin "build-vscode-common" ''
#!/usr/bin/env bash
Expand All @@ -69,13 +69,13 @@ let
install-eslint-config-utopia
build-utopia-vscode-common
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/editor
${pnpm}/bin/pnpm install
${pnpm}/bin/pnpm install --silent
'')
(pkgs.writeScriptBin "install-website" ''
#!/usr/bin/env bash
set -e
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/website-next
${pnpm}/bin/pnpm install
${pnpm}/bin/pnpm install --silent
'')
(pkgs.writeScriptBin "install-website-editor-ci" ''
#!/usr/bin/env bash
Expand Down Expand Up @@ -239,7 +239,7 @@ let
#!/usr/bin/env bash
set -e
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/utopia-vscode-common
${pnpm}/bin/pnpm install
${pnpm}/bin/pnpm install --silent
${pnpm}/bin/pnpm run build
'')
(pkgs.writeScriptBin "build-utopia-vscode-common-production" ''
Expand Down
Loading