This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* CameraTester.js */ | |
import { RNCamera } from 'react-native-camera'; | |
function CameraTester({ type }) { | |
const handleDetectedFaces = ({ faces }) => { | |
return /* test succeeded */; | |
}; | |
const handleDetectionError = error => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Circle.js */ | |
import { View } from 'react-native'; | |
function Circle({ style, radius, color }) { | |
return ( | |
<View | |
style={[ | |
{ | |
width: radius * 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* BatteryManager.js */ | |
import { NativeModules } from 'react-native'; | |
const { BatteryManagerModule } = NativeModules; | |
const BatteryManager = { | |
getHealth: BatteryManagerModule.getHealth, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Smartphone::Contract::Cancel < BaseInteraction | |
def call | |
return unless valid_interaction? | |
if can_cancel_certificate? | |
return if local_certificate_canceled.success? | |
enqueue_cancel_remote_job | |
end | |
persist_model! | |
nofity_user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Smartphone::Contract::ChangeDevice < BaseInteraction | |
def call | |
return unless valid_interaction? | |
persist_models! | |
return unless changed_certificate.success? | |
check_imei_async | |
notify_user | |
end | |
def valid_interaction? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Smartphone::Contract::Change < BaseInteraction | |
def call | |
return unless valid_interaction? | |
persist_models! | |
change_certificate | |
end | |
def valid_interaction? | |
not_suspended? | |
&& invoices_settled? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class Smartphone::Contract::CancelTest < ActiveSupport::TestCase | |
setup do | |
@smartphone_contract = smartphone_contracts(:base_contract) | |
@params = { id: @smartphone_contract[:id], ... } | |
end | |
subject { Smartphone::Contract::Cancel } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class Smartphone::Contract::ChangeDeviceTest < ActiveSupport::TestCase | |
setup do | |
@smartphone_contract = smartphone_contracts(:base_contract) | |
@params = { id: @smartphone_contract[:id], imei: '...', imei_secondary: '...', ... } | |
end | |
subject { Smartphone::Contract::ChangeDevice } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class Smartphone::Contract::ChangeTest < ActiveSupport::TestCase | |
setup do | |
@smartphone_contract = smartphone_contracts(:base_contract) | |
@params = { id: @smartphone_contract[:id], ... } | |
end | |
subject { Smartphone::Contract::Change } | |
NewerOlder