File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import React from 'react';
66
77function TabCloseButton ( props : { onClick : ( ) => void } ) {
88 return (
9- < button
9+ < div
10+ role = "button"
11+ aria-pressed = { false }
1012 className = "close"
1113 aria-label = "Close Tab"
1214 title = "Close Tab"
Original file line number Diff line number Diff line change @@ -551,6 +551,7 @@ div.CodeMirror-lint-tooltip > * + * {
551551} */
552552
553553.graphiql-container .tab .close {
554+ display : inline-block;
554555 cursor : pointer;
555556 border : none;
556557 background : transparent;
Original file line number Diff line number Diff line change @@ -24,4 +24,9 @@ describe('fuzzyExtractionOperationTitle', () => {
2424 it ( 'should return null for anonymous queries' , ( ) => {
2525 expect ( fuzzyExtractOperationTitle ( '{}' ) ) . toEqual ( '<untitled>' ) ;
2626 } ) ;
27+ it ( 'should not extract query names with comments' , ( ) => {
28+ expect ( fuzzyExtractOperationTitle ( '# query My_3xampleQuery() {}' ) ) . toEqual (
29+ '<untitled>' ,
30+ ) ;
31+ } ) ;
2732} ) ;
Original file line number Diff line number Diff line change 22 * Very simple and quick way of extracting the operation title from a document string (compared to parsing and traversing the whole AST).
33 */
44export function fuzzyExtractOperationTitle ( str : string ) : string {
5- const regex = / ( q u e r y | s u b s c r i p t i o n | m u t a t i o n ) ( [ a - z A - Z 0 - 9 _ ] + ) / ;
5+ const regex = / ^ [ ^ # ] ( q u e r y | s u b s c r i p t i o n | m u t a t i o n ) ( [ a - z A - Z 0 - 9 _ ] + ) / ;
66 const match = regex . exec ( str ) ;
77
88 return match ?. [ 2 ] ?? '<untitled>' ;
You can’t perform that action at this time.
0 commit comments