Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Platov <[email protected]>
  • Loading branch information
SasLord committed May 21, 2024
1 parent ac9677d commit 522edae
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,22 @@
>
<DocHierarchy {documents} {descendants} {documentById} {selected} />
<svelte:fragment slot="visible">
{#if selected !== undefined && visibleItem !== undefined}
{#if selected && visibleItem}
{@const item = visibleItem}
<DocTreeElement
doc={visibleItem}
icon={visibleItem.icon === view.ids.IconWithEmoji ? IconWithEmoji : visibleItem.icon ?? document.icon.Document}
iconProps={visibleItem.icon === view.ids.IconWithEmoji
doc={item}
icon={item.icon === view.ids.IconWithEmoji ? IconWithEmoji : item.icon ?? document.icon.Document}
iconProps={item.icon === view.ids.IconWithEmoji
? { icon: visibleItem.color }
: {
fill:
visibleItem.color !== undefined
? getPlatformColorDef(visibleItem.color, $themeStore.dark).icon
: 'currentColor'
fill: item.color !== undefined ? getPlatformColorDef(item.color, $themeStore.dark).icon : 'currentColor'
}}
title={visibleItem.name}
title={item.name}
selected
isFold
empty
actions={getDocActions(visibleItem)}
moreActions={() => getMoreActions(visibleItem)}
actions={getDocActions(item)}
moreActions={() => getMoreActions(item)}
/>
{/if}
</svelte:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { createQuery, getClient } from '@hcengineering/presentation'
import { Action, navigate, IconEdit } from '@hcengineering/ui'
import { TreeNode, TreeItem, getActions as getContributedActions } from '@hcengineering/view-resources'
import { getResource } from '@hcengineering/platform'
import { getResource } from '@hcengineering/platform'
import drive from '../plugin'
import { getDriveLink, getFolderIdFromFragment, getFolderLink } from '../navigation'
Expand Down Expand Up @@ -122,15 +122,16 @@
}}
/>
<svelte:fragment slot="visible">
{#if selected !== undefined && visibleItem !== undefined}
{#if selected && visibleItem}
{@const folder = visibleItem}
<TreeItem
_id={visibleItem._id}
_id={folder._id}
icon={drive.icon.Folder}
title={visibleItem.name}
title={folder.name}
selected
isFold
empty
actions={async () => await getFolderActions(visibleItem)}
actions={async () => await getFolderActions(folder)}
/>
{/if}
</svelte:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
}}
>
<svelte:fragment slot="dropbox">
{#if (desc.length > 0) && !once}
{#if desc.length > 0 && !once}
<svelte:self folders={desc} {descendants} {folderById} {selected} level={level + 1} on:selected />
{/if}
</svelte:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
</div>
</div>
<Scroller>
<NavGroup label={setting.string.Classes} selected={_class !== undefined} categoryName={'classes'} second>
<NavGroup label={setting.string.Classes} selected={_class !== undefined} categoryName={'classes'} noDivider>
<ClassHierarchy
{classes}
{_class}
Expand Down
10 changes: 6 additions & 4 deletions tests/sanity/tests/model/contacts/contract-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export class ContractPage {

readonly appContact = (): Locator => this.page.locator('[id="app-contact\\:string\\:Contacts"]')
readonly employeeNavElement = (Employee: string): Locator =>
this.page.locator(`.antiNav-element:has-text("${Employee}")`)
this.page.locator(`.hulyNavItem-container:has-text("${Employee}")`)

readonly employeeButton = (Employee: string): Locator =>
this.page.locator(`button:not(.hulyNavItem-container):has-text("${Employee}")`)

readonly employeeButton = (Employee: string): Locator => this.page.locator(`button:has-text("${Employee}")`)
readonly firstNameInput = (): Locator => this.page.locator('[placeholder="First name"]')
readonly lastNameInput = (): Locator => this.page.locator('[placeholder="Last name"]')
readonly emailInput = (): Locator => this.page.locator('[placeholder="Email"]')
Expand Down Expand Up @@ -54,8 +56,8 @@ export class ContractPage {
readonly personName = (person: string): Locator => this.page.locator(`text=${person}`)
readonly personTable = (): Locator => this.page.locator('.antiTable-body__row')
readonly personMarina = (): Locator => this.page.getByRole('link', { name: 'MM M. Marina' })
readonly comapnyTab = (): Locator => this.page.locator('.antiNav-element:has-text("Company")')
readonly addCompany = (): Locator => this.page.locator('button:has-text("Company")')
readonly comapnyTab = (): Locator => this.page.locator('.hulyNavItem-container:has-text("Company")')
readonly addCompany = (): Locator => this.page.locator('button.antiButton:has-text("Company")')
readonly companyName = (): Locator => this.page.locator('[placeholder="Company name"]')
readonly companyCreateButton = (): Locator => this.page.locator('button:has-text("Create")')
readonly companyByName = (company: string): Locator => this.page.locator(`text=${company}`)
Expand Down
35 changes: 19 additions & 16 deletions tests/sanity/tests/model/documents/documents-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class DocumentsPage extends CommonPage {
readonly buttonCreateDocument = (): Locator =>
this.page.locator('div[data-float="navigator"] button[id="new-document"]')

readonly divTeamspacesParent = (): Locator => this.page.locator('div#tree-teamspaces').locator('xpath=..')
readonly buttonCreateTeamspace = (): Locator => this.page.locator('div#tree-teamspaces > button')
readonly divTeamspacesParent = (): Locator => this.page.locator('div#navGroup-tree-teamspaces').locator('xpath=../button[1]')
readonly buttonCreateTeamspace = (): Locator => this.page.locator('button#tree-teamspaces')
readonly formNewTeamspace = (): Locator => this.page.locator('form[id="document:string:NewTeamspace"]')
readonly formEditTeamspace = (): Locator => this.page.locator('form[id="document:string:EditTeamspace"]')
readonly inputModalNewTeamspaceTitle = (): Locator =>
Expand Down Expand Up @@ -62,25 +62,27 @@ export class DocumentsPage extends CommonPage {

async openTeamspace (name: string): Promise<void> {
const classes = await this.page
.locator('div.antiNav-element span[class*="label"]', { hasText: name })
.locator('xpath=..')
.locator('button.hulyNavGroup-header span[class*="label"]', { hasText: name })
.locator('xpath=../..')
.getAttribute('class')
if (classes != null && classes.includes('collapsed')) {
await this.page.locator('div.antiNav-element span[class*="label"]', { hasText: name }).click()
if (classes != null && !classes.includes('isOpen')) {
await this.page.getByRole('button', { name }).click()
}
}

async checkTeamspaceExist (name: string): Promise<void> {
await expect(this.page.locator('div[class*="dropbox"] span[class*="label"]', { hasText: name })).toHaveCount(1)
await expect(this.page.locator('div[class*="hulyNavGroup-content"] span[class*="label"]', { hasText: name })).toHaveCount(1)
}

async checkTeamspaceNotExist (name: string): Promise<void> {
await expect(this.page.locator('div[class*="dropbox"] span[class*="label"]', { hasText: name })).toHaveCount(0)
await expect(
this.page.locator('button[class*="hulyNavGroup-header"] span[class*="label"]', { hasText: name })
).toHaveCount(0)
}

async moreActionTeamspace (name: string, action: string): Promise<void> {
await this.page.locator('div[class*="dropbox"] > div > span[class*="label"]', { hasText: name }).hover()
await this.page.locator(`xpath=//span[text()="${name}"]/../div[last()]`).click()
await this.page.locator('button.hulyNavGroup-header span[class*="label"]', { hasText: name }).hover()
await this.page.locator(`xpath=//span[text()="${name}"]/../../div[@class="hulyNavGroup-header__tools"]/button[last()]`).click()
await this.selectFromDropdown(this.page, action)
}

Expand All @@ -89,14 +91,14 @@ export class DocumentsPage extends CommonPage {
}

async openDocument (name: string): Promise<void> {
await this.page.locator('div.tree > span[class*="label"]', { hasText: name }).click()
await this.page.locator('button.hulyNavItem-container > span[class*="label"]', { hasText: name }).click()
}

async openDocumentForTeamspace (spaceName: string, documentName: string): Promise<void> {
await this.page
.locator('div.parent > span[class*="label"]', { hasText: spaceName })
.locator('xpath=../following-sibling::div[1]')
.locator('div.tree > span[class*="label"]', { hasText: documentName })
.locator('button.hulyNavGroup-header span[class*="label"]', { hasText: spaceName })
.locator('xpath=../../following-sibling::div[1]')
.locator('button.hulyNavItem-container span[class*="label"]', { hasText: documentName })
.click()
}

Expand All @@ -120,10 +122,11 @@ export class DocumentsPage extends CommonPage {
}

async moreActionsOnDocument (documentName: string, action: string): Promise<void> {
await this.page.locator('button.hulyNavItem-container span[class*="label"]', { hasText: documentName }).hover()
await this.page
.locator('div.tree > span[class*="label"]', { hasText: documentName })
.locator('button.hulyNavItem-container > span[class*="label"]', { hasText: documentName })
.locator('xpath=..')
.locator('div[class*="tool"]:nth-child(6)')
.locator('div.hulyNavItem-actions > button:last-child')
.click()
await this.selectFromDropdown(this.page, action)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/sanity/tests/model/recruiting/applications-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class ApplicationsPage extends CommonRecruitingPage {
}

readonly pageHeader = (): Locator => this.page.locator('span[class*="header"]', { hasText: 'Applications' })
readonly buttonCreateApplication = (): Locator => this.page.locator('button > span', { hasText: 'Application' })
readonly buttonCreateApplication = (): Locator => this.page.locator('button.antiButton > span', { hasText: 'Application' })
readonly buttonTalentSelector = (): Locator => this.page.locator('div[id="vacancy.talant.selector"]')
readonly buttonSpaceSelector = (): Locator => this.page.locator('div[id="space.selector"]')
readonly buttonAssignedRecruiter = (): Locator =>
Expand Down

0 comments on commit 522edae

Please sign in to comment.