Skip to content

Commit

Permalink
chore: upgrading caused changes to scroll and viewport size
Browse files Browse the repository at this point in the history
  • Loading branch information
gtk-grafana committed Oct 22, 2024
1 parent 05217ef commit 0188a50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
],
"roles": [],
"dependencies": {
"grafanaDependency": ">=11.2.0",
"grafanaDependency": ">=11.3.0",
"plugins": []
},
"preload": true,
Expand Down
11 changes: 3 additions & 8 deletions tests/exploreServicesBreakDown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe('explore services breakdown page', () => {
test('should filter logs panel on search for broadcast field', async ({ page }) => {
await explorePage.serviceBreakdownSearch.click();
await explorePage.serviceBreakdownSearch.fill('broadcast');
await expect(page.getByRole('table').locator('tr').first().getByText('broadcast')).toBeVisible();
await expect(page.getByRole('table').locator('tr').first().getByText('broadcast').first()).toBeVisible();
await expect(page).toHaveURL(/broadcast/);
});

Expand Down Expand Up @@ -394,7 +394,6 @@ test.describe('explore services breakdown page', () => {
const json = await response.json();
return route.fulfill({ response, json });
});

// Navigate to fields tab
await explorePage.goToFieldsTab();
// Make sure the panels have started to render
Expand All @@ -403,19 +402,15 @@ test.describe('explore services breakdown page', () => {
await explorePage.assertTabsNotLoading();
// Fields on top should be loaded
expect(requestCount).toEqual(6);

await explorePage.scrollToBottom();
// Panel on the bottom should be visible
await expect(page.getByTestId(/data-testid Panel header/).last()).toBeInViewport();

// Panel on the top should not
await expect(page.getByTestId(/data-testid Panel header/).first()).not.toBeInViewport();

// Wait for a bit for the requests to be made
await page.waitForTimeout(250);

await page.waitForTimeout(1000);
// if this flakes we could just assert that it's greater then 3
expect(requestCount).toEqual(14);
expect(requestCount).toEqual(17);
});

test(`should select field ${fieldName}, update filters, open log panel`, async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/explore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ExplorePage {
}

async setDefaultViewportSize() {
await this.page.setViewportSize({ width: 1280, height: 720 });
await this.page.setViewportSize({ width: 1280, height: 680 });
}

async setExtraTallViewportSize() {
Expand Down Expand Up @@ -82,7 +82,7 @@ export class ExplorePage {
}

async scrollToBottom() {
const main = this.page.locator('main#pageContent');
const main = this.page.locator('html');

// Scroll the page container to the bottom
await main.evaluate((main) => main.scrollTo(0, main.scrollHeight));
Expand Down

0 comments on commit 0188a50

Please sign in to comment.