小编J D*_*awg的帖子

Office 365高级威胁防护正在标记我的Firebase身份验证电子邮件

我今天才意识到,我完全合法的Firebase后端发送的授权电子邮件被Microsoft Outlook的"高级威胁防护"标记为恶意

在此输入图像描述

除了可能在开发期间被标记,因为我发送自己重复的确认电子邮件以测试功能,因此没有理由这样做.

此警告不会出现在常规的Hotmail/Outlook帐户中,但我是Office 365订阅者,因此看起来我很幸运能够获得这种"高级"保护,保护我免受我自己的完全非恶意网站的攻击.

我应该联系Microsoft或Firebase寻求解决方案吗?

非常感谢!

更新:我联系了Firebase支持并收到以下信息:

我的名字是来自Firebase支持的XXXX,感谢您与我们联系,Microsoft服务的问题,例如此"高级威胁防护"不属于我所在的领域或专业知识,我建议与Microsoft就此问题开一张票,我请注意Stack Overflow上已有一个主题,请务必查看其他Firebase社区渠道.

我知道这不是谷歌要解决的问题,但似乎任何使用电子邮件验证的Firebase应用程序都会遇到微软电子邮件系统的问题.这是很多企业和政府系统......

有关如何从谷歌或微软获得关注的任何建议吗?

outlook ms-office office365 firebase firebase-authentication

5
推荐指数
1
解决办法
364
查看次数

TDD期间Vue实例上的模拟方法

在构建Vue应用程序时,我正在学习TDD,并尝试遵守严格的法律,即仅编写足够的生产代码来满足失败的单元测试。我确实很喜欢这种方法,但是在向Vue实例添加方法并测试事件是否从模板中的元素触发时调用方法方面遇到了障碍。

我无法找到关于如何模拟Vue方法的任何建议,因为如果我模拟代理方法,最终将不会被调用(我正在使用Jest和Vue Test Utils)。

我也在使用赛普拉斯(Cypress),因此我可以在e2e中填写此测试,但我希望能够涵盖更多的单元测试。

我拥有Edd Yerburgh的书“ Testing Vuejs Applications”,但在有关测试组件方法的部分中,他只是简单地指出以下内容:

“通常,组件在内部使用方法。例如,单击按钮时登录到控制台........您可以将它们视为私有方法,它们不打算在组件外部使用。私有方法是实现细节,因此您不能直接为它们编写测试。”

这种方法显然不允许遵循更严格的TDD法则,那么TDD纳粹如何处理呢?

谢谢你的时间。

// ButtonComponent.vue

<template>
    <button @click="method">Click me</button>
</template>

<script>
    export default: {
        methods: {
            method () {
                // Have I been called?
            }
        }
    }
</script>
Run Code Online (Sandbox Code Playgroud)

这是我的测试,如果有帮助的话:

// ButtonComponent.spec.js

it('will call the method when clicked, () => {

    const wrapper = shallowMount(ButtonComponent)

    const mockMethod = jest.fn()

    wrapper.vm.method = mockMethod

    const button = wrapper.find('button')

    button.vm.$emit('click')

    expect(mockMethod).toHaveBeenCalled()
    // Expected mock function to have been called, but it was not called …
Run Code Online (Sandbox Code Playgroud)

tdd vue.js jestjs vuejs2 vue-test-utils

5
推荐指数
1
解决办法
1520
查看次数

使用 Vue Test Utils 将模拟方法传递给 mount/shallowMount

有人可以向我解释一下为什么在测试中无法通过包装对象访问传入对象的methods模拟函数,而必须首先创建一个变量作为对模拟函数的引用来访问它吗?shallowMount

我尝试过 mount 和shallowMount、创建/安装的钩子,也尝试过直接调用函数,而不是在创建/安装的钩子内部调用。

// TestComponent.spec.js

import TestComponent from '@/components/TestComponent'
import { shallowMount, createLocalVue } from '@vue/test-utils'

const localVue = createLocalVue()

const setLoadingMock = jest.fn() // mock function that is accessible in the test

function createWrapper () {

  const defaultMountingOptions = {
    localVue,
    methods: {
      setLoading: setLoadingMock
    }
  }

  return shallowMount(TestComponent, defaultMountingOptions)
}

describe('TestComponent.vue', () => {

  let wrapper

  beforeEach(() => {
    wrapper = createWrapper()
  });

  it('will call setLoading', () => {
    expect(wrapper.vm.setLoading).toHaveBeenCalled() 
    // FAILS. Console message: …
Run Code Online (Sandbox Code Playgroud)

vue.js jestjs vue-test-utils

5
推荐指数
1
解决办法
6979
查看次数