Skip to content

Commit

Permalink
update mock import
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jan 21, 2025
1 parent 7d35b5d commit 8007b11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const MOCKS = [
// This file must be mocked because Jest can't handle `import.meta.url`.
jest.mock('../../graph/asyncGraphLayout', () => ({}));

jest.mock('shared/asset-selection/useAssetSelectionInput', () => {
jest.mock('shared/asset-selection/input/useAssetSelectionInput', () => {
const mock: typeof useAssetSelectionInput = ({
assets,
assetsLoading,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {ParserRuleContext} from 'antlr4ts';
import {AttributeValueContext} from './generated/SelectionAutoCompleteParser';

export const removeQuotesFromString = (value: string) => {
if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') {
Expand All @@ -17,6 +18,8 @@ export function getValueNodeValue(ctx: ParserRuleContext | null) {
return ctx.text.slice(0, -1);
case 'QuotedStringValueContext':
return ctx.text.slice(1, -1);
case 'AttributeValueContext':
return getValueNodeValue((ctx as AttributeValueContext).value());
default:
return ctx?.text ?? '';
}
Expand Down

0 comments on commit 8007b11

Please sign in to comment.