test(api): Remove deprecated tab-related tests

Remove tests for tabs and 3-column layout that no longer exist.
Keep basic API reference tests and RapiDoc Mini component tests.
worktree-2025-12-30T19-16-55
Jason Stirnaman 2025-12-12 13:15:22 -06:00
parent 4c5d99d8cf
commit cccd6e5143
1 changed files with 6 additions and 104 deletions

View File

@ -127,12 +127,11 @@ describe('API reference content', () => {
});
/**
* 3-Column API Reference Layout Tests
* Tests the new layout for InfluxDB 3 Core/Enterprise API documentation
* Tests individual API endpoint pages which use the 3-column layout with tabs
* API Reference Layout Tests
* Tests layout and renderer for InfluxDB 3 Core/Enterprise API documentation
*/
describe('API reference 3-column layout', () => {
// Individual API endpoint pages (not index pages) have the 3-column layout
describe('API reference layout', () => {
// API tag pages have RapiDoc renderer
const layoutSubjects = [
'/influxdb3/core/api/v3/engine/',
'/influxdb3/enterprise/api/v3/engine/',
@ -160,94 +159,9 @@ describe('API reference 3-column layout', () => {
});
it('displays API content area', () => {
cy.get('.api-content, .content-wrapper').should('exist');
});
it('displays TOC on desktop viewport', () => {
cy.viewport(1280, 800);
cy.get('.api-toc').should('be.visible');
});
it('hides TOC on mobile viewport', () => {
cy.viewport(375, 667);
cy.get('.api-toc').should('not.be.visible');
});
});
describe('API Navigation', () => {
it('displays API navigation section', () => {
cy.get('.api-nav').should('exist');
});
it('has collapsible navigation groups', () => {
cy.get('.api-nav-group').should('have.length.at.least', 1);
});
it('toggles group expand/collapse', () => {
cy.get('.api-nav-group-header').first().as('header');
cy.get('@header').click();
cy.get('@header')
.should('have.attr', 'aria-expanded')
.and('match', /true|false/);
});
});
describe('Tab Navigation', () => {
it('displays tabs', () => {
cy.get('.api-tabs-wrapper').should('exist');
});
it('shows Operations tab content by default', () => {
cy.get('[data-tab-panel="operations"]').should('be.visible');
});
it('switches tabs on click without page jump', () => {
// Get initial scroll position
cy.window().then((win) => {
const initialScroll = win.scrollY;
// Click the second tab
cy.get('.api-tabs-nav a').eq(1).click();
// Verify tabs are still visible (not jumped away)
cy.get('.api-tabs-wrapper').should('be.visible');
// Verify the clicked tab is now active
cy.get('.api-tabs-nav a').eq(1).should('have.class', 'is-active');
// Verify the first tab is no longer active
cy.get('.api-tabs-nav a')
.eq(0)
.should('not.have.class', 'is-active');
});
});
it('updates URL hash when switching tabs', () => {
cy.get('.api-tabs-nav a[data-tab="server"]').click();
cy.url().should('include', '#server');
});
it('restores tab from URL hash on page load', () => {
// Use the current subject URL with hash instead of hardcoded old reference URL
cy.visit(`${subject}#authentication`);
cy.get('.api-tabs-nav a[data-tab="authentication"]').should(
'have.class',
'is-active'
cy.get('.api-content, .content-wrapper, .article--content').should(
'exist'
);
cy.get('[data-tab-panel="authentication"]').should('be.visible');
});
});
describe('Table of Contents', () => {
it('displays TOC header', () => {
cy.viewport(1280, 800);
cy.get('.api-toc-header').should('contain', 'ON THIS PAGE');
});
it('generates TOC from headings', () => {
cy.viewport(1280, 800);
cy.wait(500); // Wait for component initialization
cy.get('.api-toc-nav').should('exist');
});
});
@ -257,18 +171,6 @@ describe('API reference 3-column layout', () => {
'.api-reference-container, rapi-doc, .api-reference-wrapper'
).should('exist');
});
it('displays spec download link', () => {
cy.get('.api-spec-download').should('exist');
});
});
describe('Accessibility', () => {
it('has ARIA attributes on nav groups', () => {
cy.get('.api-nav-group-header').each(($header) => {
cy.wrap($header).should('have.attr', 'aria-expanded');
});
});
});
});
});