Merge pull request #444 from ueokande/qa-0.16

QA 0.16
jh-changes
Shin'ya Ueoka 6 years ago committed by GitHub
commit 2795025d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      QA.md
  2. 2583
      package-lock.json
  3. 22
      package.json
  4. 2
      src/background/usecases/link.js
  5. 9
      src/settings/components/index.jsx
  6. 3
      src/settings/reducers/setting.js
  7. 9
      src/shared/settings/default.js
  8. 2
      src/shared/settings/properties.js
  9. 2
      src/shared/settings/validator.js
  10. 2
      test/settings/reducers/setting.test.js

20
QA.md

@ -30,6 +30,8 @@ The behaviors of the console are tested in [Console section](#consoles).
- [ ] <kbd>y</kbd>: yank current URL and show a message
- [ ] <kbd>p</kbd>: open clipboard's URL in current tab
- [ ] <kbd>P</kbd>: open clipboard's URL in new tab
- [ ] <kbd>p</kbd>: search clipboard's keywords in current tab
- [ ] <kbd>P</kbd>: search clipboard's keywords in new tab
- [ ] Toggle enabled/disabled of plugin bu <kbd>Shift</kbd>+<kbd>Esc</kbd>
- [ ] Hide error and info console by <kbd>Esc</kbd>
- [ ] Vim-Vixen icons changes on <kbd>Shift</kbd>+<kbd>Esc</kbd>
@ -56,32 +58,35 @@ The behaviors of the console are tested in [Console section](#consoles).
#### Exec a command
- [ ] `<EMPTY>`, `<SP>`: do nothing
- [ ] `<EMPTY>`: do nothing
<br>
- [ ] `open an apple`: search with keywords "an apple" by default search engine (google)
- [ ] `open github.com`: open github.com
- [ ] `open https://github.com`: open github.com
- [ ] `open yahoo an apple`: search with keywords "an apple" by yahoo.com
- [ ] `open yahoo`,`open yahoo<SP>`: search with empty keywords; yahoo redirects to top page
- [ ] `open`,`open<SP>`: open default search engine
- [ ] `open yahoo`: search with empty keywords; yahoo redirects to top page
- [ ] `open`: open default search engine
<br>
- [ ] `tabopen`: do above tests replaced `open` with `tabopen`, and verify the page is opened in new tab
- [ ] `winopen`: do above tests replaced `open` with `winopen`, and verify the page is opened in new window
<br>
- [ ] `buffer`,`buffer<SP>`: do nothing
- [ ] `buffer`: do nothing
- [ ] `buffer <title>`, `buffer <url>`: select tab which has an title matched with
- [ ] `buffer 1`: select leftmost tab
- [ ] `buffer 0`, `buffer <a number more than count of tabs>`: shows an error
- [ ] select tabs rotationally when more than two tabs are matched
- [ ] `buffer %`: select current tab (nothing to do)
- [ ] `buffer #`: select last selected tab
<br>
- [ ] `addbookmark` creates a bookmark
<br>
- [ ] `q`, `quit`: close current tab
- [ ] `qa`, `quitall`: close all tabs
- [ ] `bdelete`: delete a not-pinned tab matches with keywords
- [ ] `bdelete`: show errors no-tabs or more than 1 tabs matched
- [ ] `bdelete`: can not delete pinned tab
@ -94,20 +99,20 @@ The behaviors of the console are tested in [Console section](#consoles).
#### History and search engines
- [ ] `open`: show no completions
- [ ] `open<SP>`: show all engines and some history items
- [ ] `open g`: complete search engines starts with `g` and matched with keywords `g`
- [ ] `open foo bar`: complete history items matched with keywords `foo` and `bar`
- [ ] `set `: show prperties starts with keywords
- [ ] The completions shows histories, search engines, and bookmarks.
- [ ] also `tabopen` and `winopen`
- shortening commands such as `o` are not test in this release
- [ ] Show completions for `:open`/`:tabopen`/`:buffer` on opening just after closed
- [ ] Complete commands matched with input keywords in the prefix.
#### Buffer command
- [ ] `buffer`: show no completions
- [ ] `buffer<SP>`: show all opened tabs in completion
- [ ] `buffer x`: show tabs which has title and URL matches with `x`
- [ ] shows tab index and marks
#### Buffer command
@ -207,7 +212,6 @@ The behaviors of the console are tested in [Console section](#consoles).
## Misc
- [ ] Work after plugin reload
- [ ] Work on `about:blank`
- [ ] Able to map `<A-Z>` key.
- [ ] Open file menu by <kbd>Alt</kbd>+<kbd>F</kbd> (Other than Mac OS)

2583
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -23,16 +23,16 @@
"homepage": "https://github.com/ueokande/vim-vixen",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-eslint": "^8.2.6",
"babel-loader": "^7.1.5",
"babel-preset-preact": "^1.1.0",
"babel-preset-stage-2": "^6.24.1",
"chai": "^4.1.2",
"css-loader": "^1.0.0",
"eslint": "^5.0.1",
"eslint-plugin-react": "^7.8.2",
"eslint": "^5.2.0",
"eslint-plugin-react": "^7.10.0",
"html-webpack-plugin": "^3.2.0",
"karma": "^2.0.2",
"karma": "^2.0.5",
"karma-firefox-launcher": "^1.1.0",
"karma-html2js-preprocessor": "^1.1.0",
"karma-mocha": "^1.3.0",
@ -40,19 +40,19 @@
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.0",
"mocha": "^5.1.1",
"mocha": "^5.2.0",
"node-firefox-connect": "^1.2.0",
"node-sass": "^4.9.0",
"node-sass": "^4.9.2",
"preact": "^8.2.9",
"preact-redux": "^2.0.3",
"redux": "^4.0.0",
"redux-promise": "^0.6.0",
"sass-loader": "^7.0.1",
"sass-loader": "^7.0.3",
"sinon-chrome": "^2.3.2",
"style-loader": "^0.21.0",
"web-ext": "github:ueokande/web-ext#patched-2.6.0",
"web-ext": "github:ueokande/web-ext#patched-2.7.0",
"webextensions-api-fake": "^0.5.1",
"webpack": "^4.8.3",
"webpack-cli": "^3.0.7"
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0"
}
}

@ -15,7 +15,7 @@ export default class LinkInteractor {
let settings = await this.settingRepository.get();
let { adjacenttab } = settings.properties;
if (adjacenttab) {
return this.tabPresenter.create(url, {
return this.tabPresenter.createAdjacent(url, {
openerTabId: openerId, active: !background
});
}

@ -68,6 +68,7 @@ class SettingsComponent extends Component {
render() {
let fields = null;
let disabled = this.props.error.length > 0;
if (this.props.source === 'form') {
fields = this.renderFormFields(this.props.form);
} else if (this.props.source === 'json') {
@ -84,7 +85,8 @@ class SettingsComponent extends Component {
label='Use form'
checked={this.props.source === 'form'}
value='form'
onChange={this.bindSource.bind(this)} />
onChange={this.bindSource.bind(this)}
disabled={disabled} />
<Input
type='radio'
@ -92,8 +94,8 @@ class SettingsComponent extends Component {
label='Use plain JSON'
checked={this.props.source === 'json'}
value='json'
onChange={this.bindSource.bind(this)} />
onChange={this.bindSource.bind(this)}
disabled={disabled} />
{ fields }
</form>
</div>
@ -128,6 +130,7 @@ class SettingsComponent extends Component {
} else if (from === 'json' && to === 'form') {
let b = window.confirm(DO_YOU_WANT_TO_CONTINUE);
if (!b) {
this.forceUpdate();
return;
}
this.props.dispatch(settingActions.switchToForm(this.props.json));

@ -14,11 +14,10 @@ export default function reducer(state = defaultState, action = {}) {
source: action.source,
json: action.json,
form: action.form,
errors: '',
error: '', };
case actions.SETTING_SHOW_ERROR:
return { ...state,
error: action.text,
error: action.error,
json: action.json, };
case actions.SETTING_SWITCH_TO_FORM:
return { ...state,

@ -40,7 +40,7 @@ export default {
"zi": { "type": "zoom.in" },
"zo": { "type": "zoom.out" },
"zz": { "type": "zoom.neutral" },
"f": { "type": "follow.start", "newTab": false, "background": false },
"f": { "type": "follow.start", "newTab": false },
"F": { "type": "follow.start", "newTab": true, "background": false },
"H": { "type": "navigate.history.prev" },
"L": { "type": "navigate.history.next" },
@ -70,6 +70,11 @@ export default {
}
},
"properties": {
}
"hintchars": "abcdefghijklmnopqrstuvwxyz",
"smoothscroll": false,
"adjacenttab": true
},
"blacklist": [
]
}`,
};

@ -16,7 +16,7 @@ const defaults = {
};
const docs = {
hintchars: 'Hint characters on follow mode',
hintchars: 'hint characters on follow mode',
smoothscroll: 'smooth scroll',
adjacenttab: 'open adjacent tabs',
};

@ -27,7 +27,7 @@ const validateKeymaps = (keymaps) => {
const validateSearch = (search) => {
let engines = search.engines;
for (let key of Object.keys(engines)) {
if (/\s/.test(key)) {
if ((/\s/).test(key)) {
throw new Error(
`While space in search engine name is not allowed: "${key}"`
);

@ -25,7 +25,7 @@ describe("settings setting reducer", () => {
it('return next state for SETTING_SHOW_ERROR', () => {
let action = {
type: actions.SETTING_SHOW_ERROR,
text: 'bad value',
error: 'bad value',
json: '{}',
};
let state = settingReducer(undefined, action);