Skip to content

Commit

Permalink
Add Screener test for Chat for V2 themes (#18946)
Browse files Browse the repository at this point in the history
* Add Screener test for Chat for V2 themes

* Fix message selector
  • Loading branch information
Hirse authored Jul 15, 2021
1 parent f5120ce commit d939413
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const selectors = {
};

const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast'],
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
steps: [
builder => builder.hover(selectors.message).snapshot('Hovers the first message'),
builder => builder.click(selectors.message).snapshot('Focus the first message via mouse click'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const selectors = {
};

const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast'],
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
steps: [
builder => builder.click(selectors.reaction).snapshot('Clicks the first reaction'),
(builder, keys) => builder.keys(selectors.reaction, keys.tab).snapshot('Set focus on the second reaction'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const selectors = {
};

const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast'],
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
steps: [
(builder, keys) => builder.keys('body', keys.tab).snapshot('Focuses last message'),
(builder, keys) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { ScreenerTestsConfig } from '@fluentui/scripts/screener';
import { chatMessageClassName } from '@fluentui/react-northstar';

const config: ScreenerTestsConfig = { themes: ['teams', 'teamsDark', 'teamsHighContrast'] };
const selectors = {
message: `.${chatMessageClassName}`,
};

const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
steps: [builder => builder.hover(selectors.message).snapshot('Mouse hover on first message')],
};

export default config;
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ScreenerTestsConfig } from '@fluentui/scripts/screener';

const config: ScreenerTestsConfig = { themes: ['teams', 'teamsDark', 'teamsHighContrast'] };
const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
};

export default config;
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ScreenerTestsConfig } from '@fluentui/scripts/screener';

const config: ScreenerTestsConfig = { themes: ['teams', 'teamsDark', 'teamsHighContrast'] };
const config: ScreenerTestsConfig = {
themes: ['teams', 'teamsDark', 'teamsHighContrast', 'teamsV2', 'teamsDarkV2'],
};

export default config;
2 changes: 1 addition & 1 deletion scripts/screener/screener.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export interface ScreenerStepBuilder {
}

/** Keys of `themes` object exported from `@fluentui/react-northstar/src/index`. */
export type ScreenerThemeName = 'teams' | 'teamsDark' | 'teamsHighContrast';
export type ScreenerThemeName = 'teams' | 'teamsDark' | 'teamsHighContrast' | 'teamsV2' | 'teamsDarkV2';

export type ScreenerStep = (steps: ScreenerStepBuilder, keys: ScreenerRunnerKeys) => ScreenerStepBuilder;
export type ScreenerSteps = ScreenerStep[];
Expand Down

0 comments on commit d939413

Please sign in to comment.