forked from superdesk/superdesk-client-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:superdesk/superdesk-client-core …
…into develop
- Loading branch information
Showing
57 changed files
with
577 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {Monitoring} from './page-object-models/monitoring'; | ||
import {restoreDatabaseSnapshot, s} from './utils'; | ||
|
||
test('content profile icon', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
|
||
// expect an article to have a regular text icon | ||
|
||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await expect( | ||
page.locator(s( | ||
'monitoring-group=Sports / Working Stage', | ||
'article-item=test sports story', | ||
'type-icon', | ||
)), | ||
).toHaveAttribute('data-test-value', 'text'); | ||
|
||
|
||
// go to content profile and set icon to "map-marker" | ||
|
||
await page.goto('/#/settings/content-profiles'); | ||
await page.locator(s('content-profile=Story', 'content-profile-actions')).click(); | ||
await page.locator(s('content-profile-actions--options')).getByRole('button', {name: 'Edit'}).click(); | ||
|
||
await page.locator(s('content-profile-edit-view')).getByLabel('Icon').getByRole('button').click(); | ||
await page.getByRole('button', {name: 'map-marker'}).click(); | ||
await page.locator(s('content-profile-edit-view--footer')).getByRole('button', {name: 'Save'}).click(); | ||
|
||
await expect(page.locator(s('content-profile=Story', 'icon'))).toHaveAttribute('data-test-value', 'map-marker'); | ||
|
||
|
||
// go back to monitoring and test whether the newly set icon is being used | ||
|
||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await expect( | ||
page.locator(s( | ||
'monitoring-group=Sports / Working Stage', | ||
'article-item=test sports story', | ||
'type-icon', | ||
)), | ||
).toHaveAttribute('data-test-value', 'map-marker', {timeout: 10000}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import {Page, Locator} from '@playwright/test'; | ||
|
||
/** | ||
* .clear method from playwright doesn't work in a stable manner for editor3 inputs | ||
*/ | ||
export async function clearInput(page: Page, textInputLocator: Locator): Promise<void> { | ||
await textInputLocator.focus(); | ||
await page.keyboard.press('Meta+A'); | ||
await page.keyboard.press('Backspace'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import {IContentProfile} from 'superdesk-api'; | ||
import ng from 'core/services/ng'; | ||
import {dataStore} from 'data-store'; | ||
|
||
interface IContentProfilesApi { | ||
get(id: IContentProfile['_id']): Promise<IContentProfile>; | ||
get(id: IContentProfile['_id']): IContentProfile; | ||
} | ||
|
||
export const contentProfiles: IContentProfilesApi = { | ||
get: (id) => ng.get('content').getType(id), | ||
get: (id) => dataStore.contentProfiles.get(id), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.