@playkit-js/moderation 3.1.1 → 3.2.0-canary.2-3a1409b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/moderation",
3
- "version": "3.1.1",
3
+ "version": "3.2.0-canary.2-3a1409b",
4
4
  "main": "dist/playkit-moderation.js",
5
5
  "private": false,
6
6
  "bugs": {
@@ -15,24 +15,17 @@
15
15
  "access": "public"
16
16
  },
17
17
  "devDependencies": {
18
- "@typescript-eslint/eslint-plugin": "^5.23.0",
19
- "@typescript-eslint/parser": "^5.23.0",
20
18
  "conventional-github-releaser": "3.1.3",
21
19
  "cross-env": "^7.0.3",
22
20
  "css-loader": "^6.7.1",
23
- "documentation": "^13.2.5",
24
- "husky": "^8.0.1",
25
- "jest": "^28.1.0",
26
21
  "kaltura-player-js": "https://github.com/kaltura/kaltura-player-js.git#master",
27
- "lint-staged": "^12.4.1",
28
22
  "prettier": "^2.6.2",
29
23
  "sass": "^1.52.3",
30
24
  "sass-loader": "^12.6.0",
31
25
  "standard-version": "^9.3.2",
32
26
  "style-loader": "1.3.0",
33
27
  "ts-loader": "^9.3.0",
34
- "tslint": "^6.1.3",
35
- "typescript": "^4.6.4",
28
+ "typescript": "^4.9.4",
36
29
  "uglifyjs-webpack-plugin": "^2.2.0",
37
30
  "webpack": "^5.72.1",
38
31
  "webpack-cli": "^4.9.2",
@@ -55,14 +48,13 @@
55
48
  "build": "webpack --mode production",
56
49
  "dev": "webpack-dev-server --mode development",
57
50
  "watch": "webpack --progress --color --watch --mode development",
58
- "test": "jest",
51
+ "cypress:open": "cypress open",
52
+ "cypress:run": "cypress run",
53
+ "test:prepare": "yarn run build && yes | cp -i ./dist/playkit-moderation.js ./cypress/public/plugin.js",
54
+ "test:watch": "yarn run test:prepare && cypress open",
55
+ "test": "yarn run test:prepare && cypress run",
59
56
  "release": "standard-version",
60
57
  "pushTaggedRelease": "git push --follow-tags --no-verify origin master",
61
- "eslint": "eslint . --color",
62
- "commit:dist": "git add --force --all dist && (git commit -m 'chore: update dist' || exit 0)",
63
- "docs:generate": "documentation build flow-typed/** src/** -f md -o docs/configuration.md",
64
- "docs:serve": "documentation serve flow-typed/** src/** --watch",
65
- "precommit": "lint-staged",
66
58
  "prettier:fix": "prettier --write ."
67
59
  },
68
60
  "keywords": [
@@ -75,7 +67,8 @@
75
67
  ],
76
68
  "dependencies": {
77
69
  "@playkit-js/common": "^1.0.14",
78
- "@playkit-js/ui-managers": "^1.3.1"
70
+ "@playkit-js/ui-managers": "^1.3.1",
71
+ "cypress": "^12.2.0"
79
72
  },
80
73
  "kaltura": {
81
74
  "name": "playkit-js-moderation",
@@ -135,7 +135,7 @@ export class Moderation extends Component<MergedProps, ModerationState> {
135
135
  return (
136
136
  <OverlayPortal>
137
137
  <Overlay open onClose={onClick}>
138
- <div className={[styles.root, styles[playerSize]].join(' ')}>
138
+ <div className={[styles.root, styles[playerSize]].join(' ')} data-testid="moderationRoot">
139
139
  <div className={styles.mainWrapper}>
140
140
  <div className={styles.title}>{this.props.reportTitle}</div>
141
141
  {subtitle ? <div className={[styles.subtitle].join(' ')}>{subtitle}</div> : null}
@@ -145,7 +145,8 @@ export class Moderation extends Component<MergedProps, ModerationState> {
145
145
  tabIndex={0}
146
146
  ref={node => {
147
147
  this._buttonRef = node;
148
- }}>
148
+ }}
149
+ data-testid="selectButton">
149
150
  <div className={styles.select}>{reportContentType > -1 ? this._getContentType()?.label || '' : this.props.defaultContentType}</div>
150
151
  <div className={styles.downArrow}>
151
152
  <DownIcon />
@@ -168,7 +169,7 @@ export class Moderation extends Component<MergedProps, ModerationState> {
168
169
  }}
169
170
  />
170
171
  <div className={styles.submitWrapper}>
171
- <div className={styles.characterCounter}>{`${reportContent.length}/${reportLength}`}</div>
172
+ <div className={styles.characterCounter} data-testid="characterCounter">{`${reportContent.length}/${reportLength}`}</div>
172
173
  <Tooltip label={tooltipMessage} classNames={styles.tooltip}>
173
174
  <A11yWrapper onClick={this._handleSubmit}>
174
175
  <button
@@ -176,7 +177,8 @@ export class Moderation extends Component<MergedProps, ModerationState> {
176
177
  aria-disabled={submitButtonDisabled}
177
178
  aria-label={this.props.sendReportLabel}
178
179
  className={[styles.submitButton, submitButtonDisabled ? styles.disabled : ''].join(' ')}
179
- tabIndex={0}>
180
+ tabIndex={0}
181
+ data-testid="submitButton">
180
182
  {this.props.sendReportLabel}
181
183
  </button>
182
184
  </A11yWrapper>
@@ -14,7 +14,7 @@ export const PluginButton = ({onClick, label}: PluginButtonProps) => {
14
14
  return (
15
15
  <Tooltip label={label} type="bottom">
16
16
  <A11yWrapper onClick={onClick}>
17
- <button aria-label={label} className={ui.style.upperBarIcon}>
17
+ <button aria-label={label} className={ui.style.upperBarIcon} data-testid="moderationPluginButton">
18
18
  <Icon
19
19
  id="moderation-plugin-button"
20
20
  height={icons.BigSize}
@@ -113,7 +113,7 @@ export class Popover extends Component<PopoverProps, PopoverState> {
113
113
  this._popoverElementRef = node;
114
114
  }}
115
115
  className={[styles.reportPopover, styles.popoverComponent, styles.bottom, styles.right].join(' ')}>
116
- <div role="menu" className={styles.popoverMenu}>
116
+ <div role="menu" className={styles.popoverMenu} data-testid="popoverMenu">
117
117
  {props.options.map((el, index) => {
118
118
  return (
119
119
  <A11yWrapper