-
Notifications
You must be signed in to change notification settings - Fork 357
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
test: datagrid tests [INFENG-687] #9400
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9400 +/- ##
==========================================
- Coverage 48.62% 43.43% -5.20%
==========================================
Files 1233 909 -324
Lines 159016 119090 -39926
Branches 2777 2778 +1
==========================================
- Hits 77322 51725 -25597
+ Misses 81520 67191 -14329
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more.
|
0aa2a11
to
975bbb3
Compare
b67bc12
to
99b7883
Compare
1b05a75
to
f2011c5
Compare
4ff2b5a
to
5a080f3
Compare
006203d
to
c9ce6bb
Compare
a564611
to
caa39ab
Compare
caa39ab
to
b01efb7
Compare
sourceType: 'module', | ||
}, | ||
plugins: ['import', 'jsdoc', 'react', 'react-hooks', 'sort-keys-fix'], | ||
root: true, | ||
ignorePatterns: ['**/src/services/stream/wire.ts', '**/src/e2e/playwright-report/**'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a formatting change that came from precommit
@@ -22,5 +22,5 @@ | |||
"jsx": "react-jsx", | |||
"noFallthroughCasesInSwitch": true | |||
}, | |||
"include": ["src/**/*", "typings/**/*.ts", "*.ts", "__mocks__/**/*"] | |||
"include": ["src/**/*", "typings/**/*.ts", "*.ts", "__mocks__/**/*", ".eslintrc.js"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precommit was failing without this
} | ||
} while (await incrementScroll()); | ||
return false; | ||
throw new Error(`Column with index ${index} not found.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this approach worked better than returning false
try { | ||
return await this.scrollColumnIntoView(this.headRow.getColumnDef(s)); | ||
} catch (e) { | ||
if ((e as Error).message.indexOf('Column with index') === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if there's a better way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future, given that you're throwing the error here, you could throw an error class that extends from Error
class IndexNotFoundError extends Error {}
class NameNotFoundError extends Error {}
// ...snip
throw new IndexNotFoundError(`Column with index ${index} not found.`);
that you then check your caught error is an instance of
} catch(e) {
if(e instanceof IndexNotFoundError) {
throw new NameNotFoundError(`Column with name ${s} not found.`)
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do! I have a followup coming soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some minor comments. I also can't really evaluate the eslint changes, so someone from the web team should check those out.
Ticket
INFENG-687
Description
these are datagrid tests
async log(s: string)
on base pagedebug.ts
util. i'm open to using other namesby the way, there is still one more set of tests to write. it's all the pieces of the action menu. I'm gonna try and get the devs to write these parts.
Test Plan
Checklist
docs/release-notes/
.See Release Note for details.