Files
zeekayandHanzo Dev c85589eb27 serve the API at /v1/workspace
The base moves off /v1/team for two reasons that point the same way.

It collided: /v1/team on hanzo.team is a carve-out routed to the older
cloud service, so the moment this image shipped its own API would have
been answered by something else -- a 404 on our own endpoints, on the
host we serve from.

And workspace is the better noun. It is what the product calls itself
in its own words, and it does not read as though the API belongs to one
team among several.

No /api/ anywhere in a path we own.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-14 16:03:09 -07:00

52 lines
1.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {Page} from '@playwright/test';
import {expect, test} from '@mattermost/playwright-lib';
// Helper function to intercept API request and modify the response
async function interceptConfigWithLandingPage(page: Page, enabled: boolean) {
const apiUrl = '**/v1/workspace/config/client?format=old**';
await page.route(apiUrl, (route) => {
route.fulfill({
status: 200,
body: JSON.stringify({
EnableDesktopLandingPage: enabled,
EnableSignInWithUsername: 'true',
}),
headers: {'Content-Type': 'application/json'},
});
});
}
test('MM-T5640_1 should not see landing page ', async ({pw, page}) => {
await interceptConfigWithLandingPage(page, false);
// Navigate to your starting URL
await page.goto('/');
// Wait until the URL contains '/login'
await page.waitForURL(/.*\/login.*/);
// At this point, the URL should contain '/login'
expect(page.url()).toContain('/login');
// Verify the login page is visible
await pw.loginPage.toBeVisible();
});
test('MM-T5640_2 should see landing page', async ({pw, page}) => {
// Navigate to your starting URL
await page.goto('/');
// Wait until the URL contains '/landing'
await page.waitForURL(/.*\/landing.*/, {timeout: pw.duration.ten_sec});
// At this point, the URL should contain '/landing'
expect(page.url()).toContain('/landing');
// Verify the landing page is visible
await pw.landingLoginPage.toBeVisible();
});