mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 10:33:59 -05:00
Library updates and lint fixes (#8099)
* Minor updates only * Added explicit radix parameter (10) to all Number.parseInt() calls throughout the codebase (new lint rule) * Updated several @ts-ignore comments to @ts-expect-error for better TypeScript practices (new lint rule) * Removed unnecessary @ts-ignore comments in some mode files (ditto) * Used "none return" based arrow functions for some map stuff * Replaced a `map()` call that didn't return anything to a for() loop * Fixed up some cypress stuff, noting work for the future
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
import {setMonacoEditorContent} from '../support/utils';
|
||||
|
||||
// TODO: all these tests ought to be able to use `should(have.text, ...)`.
|
||||
describe('Monaco Editor Utilities', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/');
|
||||
@@ -33,8 +34,7 @@ describe('Monaco Editor Utilities', () => {
|
||||
const simpleCode = 'int main() { return 42; }';
|
||||
setMonacoEditorContent(simpleCode);
|
||||
|
||||
// Verify the content was set (basic check)
|
||||
cy.get('.monaco-editor').should('contain.text', 'main');
|
||||
cy.get('.monaco-editor .view-lines').first().should('contain.text', 'main');
|
||||
});
|
||||
|
||||
it('should set complex multi-line code content', () => {
|
||||
@@ -43,26 +43,23 @@ describe('Monaco Editor Utilities', () => {
|
||||
|
||||
int main() {
|
||||
std::vector<int> nums = {1, 2, 3, 4, 5};
|
||||
|
||||
|
||||
for (int num : nums) {
|
||||
std::cout << num << std::endl;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}`;
|
||||
setMonacoEditorContent(complexCode);
|
||||
|
||||
// Verify the content was set (basic check)
|
||||
cy.get('.monaco-editor').should('contain.text', 'iostream');
|
||||
cy.get('.monaco-editor').should('contain.text', 'vector');
|
||||
cy.get('.monaco-editor .view-lines').first().should('contain.text', 'iostream');
|
||||
cy.get('.monaco-editor .view-lines').first().should('contain.text', 'vector');
|
||||
});
|
||||
|
||||
it('should handle special characters and quotes', () => {
|
||||
const codeWithSpecialChars = `const char* message = "Hello, \"World\"!";
|
||||
int result = (x > 0) ? x : -x;`;
|
||||
const codeWithSpecialChars = `const char* message = "Hello, \\"World\\"!";`;
|
||||
setMonacoEditorContent(codeWithSpecialChars);
|
||||
|
||||
// Verify the content was set (basic check)
|
||||
cy.get('.monaco-editor').should('contain.text', 'Hello');
|
||||
cy.get('.monaco-editor .view-lines').first().should('contain.text', 'Hello');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user