Skip to content

fix(tests): facebook oauth tests fix#421

Closed
pajgo wants to merge 8 commits intomakeomatic:masterfrom
pajgo:fix/facebookTests
Closed

fix(tests): facebook oauth tests fix#421
pajgo wants to merge 8 commits intomakeomatic:masterfrom
pajgo:fix/facebookTests

Conversation

@pajgo
Copy link
Copy Markdown
Collaborator

@pajgo pajgo commented Sep 2, 2019

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 2, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@93b7371). Click here to learn what that means.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #421   +/-   ##
=========================================
  Coverage          ?   94.47%           
=========================================
  Files             ?      130           
  Lines             ?     2370           
  Branches          ?        0           
=========================================
  Hits              ?     2239           
  Misses            ?      131           
  Partials          ?        0
Impacted Files Coverage Δ
src/auth/oauth/utils/fb-urls.js 100% <100%> (ø)
src/auth/oauth/index.js 94.59% <81.81%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93b7371...0004129. Read the comment docs.

Comment thread test/suites/oauth/facebook.js Outdated
}).then((data) => {
Object.assign(localCache, data);
});
const createTestUser = () => createTestUserAPI();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant function

Comment thread test/suites/oauth/facebook.js Outdated
Object.assign(localCache, data);
});
const createTestUser = () => createTestUserAPI();
const createTestUserInstalledPartial = () => createTestUserAPI({ permissions: 'public_profile' });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant function

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это по-моему я писал относительно передаваемых параметров, чтобы было явно понятно что мы делаем.
В целом нас интересует 3 кейса:

  1. Новая установка (installed: false)
  2. Частичная установка - не хватает данных (например email) - { installed: true, permissions: 'public_profile' }
  3. Полная установка - { installed: true, permissions: 'нужные права' }

Comment thread test/suites/oauth/facebook.js Outdated
});

before('create test users', async () => {
facebookUser = await createTestUser();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createTestUserAPI()

Comment thread test/suites/oauth/facebook.js Outdated

before('create test users', async () => {
facebookUser = await createTestUser();
facebookUserInstalledPartial = await createTestUserInstalledPartial();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createTestUserAPI({ permissions: 'public_profile' })

* API update
* @hapi/bell error handling
* @hapi/boom error handling
* rfc update
* test cleanup
* test refactor - moved some functional to `helpers`
* delays in some operations
Comment thread src/auth/oauth/index.js

if (response) {
if (isError(response) || isHTMLRedirect(response)) {
if (isHTMLRedirect(response)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему мы здесь убрали проверку ошибка или нет? не могу понять

@AVVS
Copy link
Copy Markdown
Member

AVVS commented Sep 10, 2019

accepted & merged in #424

@AVVS AVVS closed this Sep 10, 2019
@pajgo pajgo deleted the fix/facebookTests branch September 20, 2019 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants