Skip to content

Commit

Permalink
adding new attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbykumar706584 committed Oct 3, 2023
1 parent d99da80 commit 1b760f2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
20 changes: 10 additions & 10 deletions e2e-tests/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,35 +187,35 @@ test('Increase the font size of the obs editor', async () => {
await window.click('[aria-label=increase-font]');
const editorpane = await window.innerText('[aria-label=editor-pane]', { timeout: 120000 });
expect(editorpane).toBe('EDITOR');
const div = await window.locator('//*[@id="__next"]/main/div/div[3]/div[2]')
const div = await window.locator('//*[@aria-label="editor"]')
const fontSize = await div.evaluate((ele) => {
return window.getComputedStyle(ele).getPropertyValue('font-size')

})
expect(fontSize).toBe('22.4px');
expect(await fontSize).toBe('22.4px');
});

test('Decrease the font size of the obs editor', async () => {
const editorpane = await window.innerText('[aria-label=editor-pane]', { timeout: 120000 });
expect(editorpane).toBe('EDITOR');
await window.click('[aria-label=decrease-font]');
await window.click('[aria-label=decrease-font]');
const div = await window.locator('//*[@id="__next"]/main/div/div[3]/div[2]')
const div = await window.locator('//*[@aria-label="editor"]')
const fontSize = await div.evaluate((ele) => {
return window.getComputedStyle(ele).getPropertyValue('font-size')
})
expect(fontSize).toBe('16px');
expect(await fontSize).toBe('16px');
});

test('Change the obs navigation story from 1 to 12 and edit the title', async () => {
const editorpane = await window.innerText('[aria-label=editor-pane]', { timeout: 120000 });
expect(editorpane).toBe('EDITOR');
await expect(window.locator('//*[@id="__next"]/main/div/div[3]/div[1]/div[1]/div/span[2]')).toBeVisible()
await window.locator('//*[@id="__next"]/main/div/div[3]/div[1]/div[1]/div/span[2]').click()
await window.getByRole('button', { name: "12" }).click();
await expect(window.locator('//*[@id="__next"]/main/div/div[3]/div[2]/div[1]/textarea')).toBeVisible()
await window.locator('//*[@id="__next"]/main/div/div[3]/div[2]/div[1]/textarea').fill('12. The Exodus Edit title')
const title = await window.textContent('//*[@id="__next"]/main/div/div[3]/div[2]/div[1]/textarea')
await expect(window.locator('//*[@aria-label="obs-navigation"]')).toBeVisible()
await window.locator('//*[@aria-label="obs-navigation"]').click()
await window.locator('//*[@aria-label="12"]').click();
await expect(window.locator('//*[@name="12. The Exodus"]')).toBeVisible()
await window.locator('//*[@name="12. The Exodus"]').fill('12. The Exodus Edit title')
const title = await window.textContent('//*[@name="12. The Exodus Edit title"]')
expect(title).toBe('12. The Exodus Edit title');
});

Expand Down
14 changes: 8 additions & 6 deletions e2e-tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,24 +209,25 @@ export const exportProject = async (window, expect, projectname) => {
}

export const archivedProjects = async (window, expect, projectname) => {
await expect(window.locator('//*[@id="projects-list"]')).toBeVisible()
await expect(await window.locator('//*[@id="projects-list"]')).toBeVisible()
const table = window.locator('//*[@id="projects-list"]')
const body = table.locator('//*[@id="projects-list-unstar"]')
const rows = await body.locator('tr')
for (let i = 0; i < await rows.count(); i++) {
const row = await rows.nth(i);
const tds = await row.locator('td');
if (await tds.nth(1).textContent() === projectname) {
expect(await tds.first().locator('[aria-label=unstar-project]')).toBeVisible()
expect(await tds.last().locator('[aria-label=unstar-expand-project]')).toBeVisible()
await tds.last().locator('[aria-label=unstar-expand-project]').click()
await window.waitForTimeout(1000)
await window.locator('.pl-5 > div > div').click()
await window.locator('//*[@aria-label="archive-project"]').click()
expect(await rows.count()).toBe(4)
await window.locator('//*[@aria-label="archive-active-button"]').click()
const title = await window.locator('//*[@aria-label="projects"]').textContent()
expect(await title).toBe("Archived projects")
const projectName = await window.innerText(`//div[@id="${projectname}"]`)
expect(projectName).toBe(projectname);

}
}
await window.locator('//*[@aria-label="archive-active-button"]').click()
Expand All @@ -236,19 +237,20 @@ export const archivedProjects = async (window, expect, projectname) => {

export const unarchivedProjects = async (window, expect, projectname) => {
await window.locator('//*[@aria-label="archive-active-button"]').click()
await expect(window.locator('//*[@id="projects-list"]')).toBeVisible()
await expect(await window.locator('//*[@id="projects-list"]')).toBeVisible()
const table = window.locator('//*[@id="projects-list"]')
const body = table.locator('//*[@id="projects-list-unstar"]')
const rows = await body.locator('tr')
for (let i = 0; i < await rows.count(); i++) {
const row = await rows.nth(i);
const tds = await row.locator('td');
if (await tds.nth(1).textContent() === projectname) {
expect(await tds.first().locator('[aria-label=unstar-project]')).toBeVisible()
expect(await tds.last().locator('[aria-label=unstar-expand-project]')).toBeVisible()
await tds.last().locator('[aria-label=unstar-expand-project]').click()
await window.locator('.pl-5 > div > div').click({ timeout: 4000 })
await window.locator('//*[@aria-label="archive-project"]').click()
expect(await rows.count()).toBe(2)
await window.waitForTimeout(500)
expect(await rows.count()).toBe(0)
const title = await window.locator('//*[@aria-label="projects"]').textContent()
expect(await title).toBe("Archived projects")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const SelectFile = ({ openChapter, onChapterSelect }) => (
onClick={(e) => { onChapterSelect(e, i + 1); }}
className={styles.select}
tabIndex={0}
aria-label={i+1}

Check failure on line 34 in renderer/src/components/EditorPage/ObsEditor/NavigationObs.js

View workflow job for this annotation

GitHub Actions / Lint Run

Operator '+' must be spaced
>
{i + 1}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function CustomMultiComboBox({
className="w-full border-none py-2 pl-3 pr-10 text-sm leading-5 text-gray-900 focus:ring-0"
// displayValue={(language) => language?.ang}
displayValue={(selectedList) => `${selectedList.length > 0 ? `${selectedList[0][filterParams]}${multiSelect ? '... click for more' : ''}` : ''}`}
placeholder={placeholder === 'Select Language' ? t('label-lang') : ''}
placeholder="Select Language"
onFocus={() => !open && setIsActive(true)}
onBlur={() => setIsActive(false)}
onChange={(event) => setQuery(event.target.value)}
Expand Down
1 change: 1 addition & 0 deletions renderer/src/modules/editor/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export default function Editor({
lineHeight: (fontSize > 1.3) ? 1.5 : '',
direction: `${projectScriptureDir === 'RTL' ? 'rtl' : 'auto'}`,
}}
aria-label='editor'
className="border-l-2 border-r-2 border-secondary pb-16 max-w-none overflow-auto h-full scrollbars-width"
>
{children}
Expand Down

0 comments on commit 1b760f2

Please sign in to comment.