chore: add prettier (1/3): add packages, configurations, fix lint issues (#6382)

* fix: remove redundant eslint rules

* chore: bump `prettier` to v2.8.7

* docs: vue files to use html comments for licenses

- Prettier's Vue parser freaks out if it sees a *.js style comment in a *.vue file.

* docs: more licenses for vue files

* fix: don't ignore *.vue files

* fix: use defaults for tabWidth and printWidth

* simplify .prettierignore

* enforce a printWidth of 100

* fix: use `eslint-plugin-prettier`, remove conflicting rules

* test: fix gauge tests (for real)

* test: fix notebook test selectors

* test: fix restrictedNotebook test selectors

* test: remove useless assignment

* lint: __dirname as global

* lint: revert eslint config + whitespace changes, commit new config

* style: remove unnecessary string concat of literals

* test: fix missed gauge test

* fix: use new eslint rules

* feat: add blank `.git-blame-ignore-revs` file

* docs: update to mention Prettier and format.

* Revert "test: fix gauge tests (for real)"

This reverts commit 6afad450389edc2f16ff0d00c9524621a7ba53bc.

* Revert "test: fix notebook test selectors"

This reverts commit 17fe1cbbff02e9298f041b5ea0fea5494fe54d94.

* Revert "test: fix restrictedNotebook test selectors"

This reverts commit 97e0ede826b7dd61c5443845443d806a56f3f305.

* Revert "test: fix missed gauge test"

This reverts commit e2398fc38ca94beff2066cc253173412ad47f8b9.

* test: fix gauge tests (no formatting)

* test: update notebook e2e selectors (no formatting)

* test: update restrictedNotebook e2e selectors (no formatting)

* fix: temporarily disable lint check
This commit is contained in:
Jesse Mazzella
2023-05-18 14:29:20 -07:00
committed by GitHub
parent 5df7971438
commit 172e0b23fd
213 changed files with 4204 additions and 2499 deletions

View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/* global __dirname */
/*
This test suite is dedicated to tests which verify the basic operations surrounding Notebooks.
*/
@ -80,21 +80,31 @@ test.describe('Notebook section tests', () => {
});
});
test('Default and new sections are automatically named Unnamed Section with Unnamed Page', async ({ page }) => {
// Check that the default section and page are created and the name matches the defaults
const defaultSectionName = await page.locator('.c-notebook__sections .c-list__item__name').textContent();
expect(defaultSectionName).toBe('Unnamed Section');
const defaultPageName = await page.locator('.c-notebook__pages .c-list__item__name').textContent();
expect(defaultPageName).toBe('Unnamed Page');
// Expand sidebar and add a section
const notebookSectionNames = page.locator('.c-notebook__sections .c-list__item__name');
const notebookPageNames = page.locator('.c-notebook__pages .c-list__item__name');
await expect(notebookSectionNames).toBeHidden();
await expect(notebookPageNames).toBeHidden();
// Expand sidebar
await page.locator('.c-notebook__toggle-nav-button').click();
// Check that the default section and page are created and the name matches the defaults
const defaultSectionName = await notebookSectionNames.innerText();
await expect(notebookSectionNames).toBeVisible();
expect(defaultSectionName).toBe('Unnamed Section');
const defaultPageName = await notebookPageNames.innerText();
await expect(notebookPageNames).toBeVisible();
expect(defaultPageName).toBe('Unnamed Page');
// Add a section
await page.locator('.js-sidebar-sections .c-icon-button.icon-plus').click();
// Check that new section and page within the new section match the defaults
const newSectionName = await page.locator('.c-notebook__sections .c-list__item__name').nth(1).textContent();
const newSectionName = await notebookSectionNames.nth(1).innerText();
await expect(notebookSectionNames.nth(1)).toBeVisible();
expect(newSectionName).toBe('Unnamed Section');
const newPageName = await page.locator('.c-notebook__pages .c-list__item__name').textContent();
const newPageName = await notebookPageNames.innerText();
await expect(notebookPageNames).toBeVisible();
expect(newPageName).toBe('Unnamed Page');
});
test.fixme('Section selection operations and associated behavior', async ({ page }) => {
//Create new notebook A
@ -270,10 +280,10 @@ test.describe('Notebook entry tests', () => {
// Reveal the notebook in the tree
await page.getByTitle('Show selected item in tree').click();
await page.dragAndDrop(`role=treeitem[name=/${overlayPlot.name}/]`, '.c-notebook__drag-area');
await page.getByRole('treeitem', { name: overlayPlot.name }).dragTo(page.locator('.c-notebook__drag-area'));
const embed = page.locator('.c-ne__embed__link');
const embedName = await embed.textContent();
const embedName = await embed.innerText();
await expect(embed).toHaveClass(/icon-plot-overlay/);
expect(embedName).toBe(overlayPlot.name);
@ -291,11 +301,13 @@ test.describe('Notebook entry tests', () => {
await page.getByTitle('Show selected item in tree').click();
await nbUtils.enterTextEntry(page, 'Entry to drop into');
await page.dragAndDrop(`role=treeitem[name=/${overlayPlot.name}/]`, 'text=Entry to drop into');
await page.getByRole('treeitem', { name: overlayPlot.name }).dragTo(page.locator('text=Entry to drop into'));
const existingEntry = page.locator('.c-ne__content', { has: page.locator('text="Entry to drop into"') });
const existingEntry = page.locator('.c-ne__content', {
has: page.locator('text="Entry to drop into"')
});
const embed = existingEntry.locator('.c-ne__embed__link');
const embedName = await embed.textContent();
const embedName = await embed.innerText();
await expect(embed).toHaveClass(/icon-plot-overlay/);
expect(embedName).toBe(overlayPlot.name);