mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-29 15:44:13 +00:00
Bugfix/workspace name case mismatch (#6560)
* fix: preserve workspace name casing in title bar (#6522) * fix: improve workspace display name handling in title bar --------- Co-authored-by: Uzairkazi695 <kaziuzair695@gmail.com>
This commit is contained in:
@@ -12,8 +12,8 @@ test.describe('Default Workspace', () => {
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
// Verify the workspace name is "My Workspace" in the title bar
|
||||
const workspaceName = page.locator('.workspace-name');
|
||||
await expect(workspaceName).toContainText('My Workspace');
|
||||
const workspaceName = page.getByTestId('workspace-name');
|
||||
await expect(workspaceName).toHaveText('My Workspace');
|
||||
|
||||
await app.context().close();
|
||||
await app.close();
|
||||
@@ -28,7 +28,7 @@ test.describe('Default Workspace', () => {
|
||||
const app1 = await launchElectronApp({ userDataPath });
|
||||
const page1 = await app1.firstWindow();
|
||||
await page1.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
await expect(page1.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page1.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
await app1.close();
|
||||
|
||||
@@ -36,7 +36,7 @@ test.describe('Default Workspace', () => {
|
||||
const app2 = await launchElectronApp({ userDataPath });
|
||||
const page2 = await app2.firstWindow();
|
||||
await page2.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
await expect(page2.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page2.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
await app2.context().close();
|
||||
await app2.close();
|
||||
@@ -69,7 +69,7 @@ test.describe('Default Workspace', () => {
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
// Should show "My Workspace"
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Old directory should still exist (never deleted)
|
||||
expect(fs.existsSync(defaultWorkspacePath)).toBe(true);
|
||||
@@ -106,7 +106,7 @@ test.describe('Default Workspace', () => {
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Old corrupted file should still exist (never deleted)
|
||||
const oldContent = fs.readFileSync(path.join(defaultWorkspacePath, 'workspace.yml'), 'utf8');
|
||||
@@ -150,7 +150,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// New workspace should have been created
|
||||
const newWorkspacePath = path.join(userDataPath, 'default-workspace-1');
|
||||
@@ -179,7 +179,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// New workspace should have been created (default-workspace since non-existent doesn't block)
|
||||
const newWorkspacePath = path.join(userDataPath, 'default-workspace');
|
||||
|
||||
@@ -35,7 +35,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await test.step('Verify workspace UI', async () => {
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
});
|
||||
|
||||
await test.step('Verify workspace filesystem artifacts', async () => {
|
||||
@@ -87,7 +87,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify workspace.yml has both collections
|
||||
const workspacePath = path.join(userDataPath, 'default-workspace');
|
||||
@@ -132,7 +132,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
// Verify default workspace is created
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Sample collection should NOT be created (because user has existing collections)
|
||||
const sampleCollection = page.locator('#sidebar-collection-name').getByText('Sample API Collection');
|
||||
@@ -151,7 +151,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
const app1 = await launchElectronApp({ userDataPath });
|
||||
const page1 = await app1.firstWindow();
|
||||
await page1.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
await expect(page1.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page1.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify initial workspace was created
|
||||
const workspacePath = path.join(userDataPath, 'default-workspace');
|
||||
@@ -165,7 +165,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
const app2 = await launchElectronApp({ userDataPath });
|
||||
const page2 = await app2.firstWindow();
|
||||
await page2.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
await expect(page2.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page2.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// workspace.yml should NOT have been modified
|
||||
const currentYmlContent = fs.readFileSync(path.join(workspacePath, 'workspace.yml'), 'utf8');
|
||||
@@ -188,7 +188,7 @@ test.describe('Default Workspace Migration', () => {
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify workspace was created
|
||||
const workspacePath = path.join(userDataPath, 'default-workspace');
|
||||
|
||||
@@ -183,7 +183,7 @@ docs: ''
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
// UI always shows "My Workspace"
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Should NOT create a new workspace
|
||||
expect(fs.existsSync(path.join(userDataPath, 'default-workspace-1'))).toBe(false);
|
||||
@@ -231,7 +231,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify the correct workspace was selected (workspace-2)
|
||||
const prefs = JSON.parse(fs.readFileSync(path.join(userDataPath, 'preferences.json'), 'utf8'));
|
||||
@@ -295,7 +295,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify workspace-1 was selected (not workspace-2 which is broken)
|
||||
const prefs = JSON.parse(fs.readFileSync(path.join(userDataPath, 'preferences.json'), 'utf8'));
|
||||
@@ -521,7 +521,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Since path doesn't exist but we have a valid workspace, it should use it
|
||||
// OR create a new one recovering from the existing one
|
||||
@@ -603,7 +603,7 @@ docs: ''
|
||||
const page = await app.firstWindow();
|
||||
await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 });
|
||||
|
||||
await expect(page.locator('.workspace-name')).toContainText('My Workspace');
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText('My Workspace');
|
||||
|
||||
// Verify workspace-1 was used (or workspace-2 was created recovering from workspace-1)
|
||||
const prefs = JSON.parse(fs.readFileSync(path.join(userDataPath, 'preferences.json'), 'utf8'));
|
||||
|
||||
Reference in New Issue
Block a user