TECH |
Engadget Japanese |
24インチで2万円切りも! ゲーミングディスプレーがAmazon初売りセールでお買い得価格に |
https://japanese.engadget.com/new-year-sale-gaming-display-084824389.html
|
amazon |
2022-01-03 08:48:24 |
TECH |
Engadget Japanese |
iPhone 14一部モデルはやぱりパンチホール画面採用か。新iPhone SEは5G対応の噂 |
https://japanese.engadget.com/iphone14-pro-punchhole-iphonese3-5g-080021676.html
|
bloomberg |
2022-01-03 08:00:21 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
Seleniumでasm15を操作する |
https://qiita.com/mikecat_mixc/items/be8c202c0bfebdc15090
|
textareaclearKeyboardActionsSelenium入力欄からの文字列の取得getattribute関数によりHTML要素の属性の値を取得でき、入力欄に入力されている文字列もこれで取得できるようである。 |
2022-01-03 17:17:45 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
pandasに辞書型の値を代入する時、途中から速度が異常に遅くなる |
https://teratail.com/questions/376479?rss=all
|
|
2022-01-03 17:51:18 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
ci上でChromeインストール失敗でRedisにつながらない |
https://teratail.com/questions/376478?rss=all
|
ci上でChromeインストール失敗でRedisにつながらない開発環境がDockerで、ローカルでパスするRSpecスペックを形成し、circleciでビルドを試みています。 |
2022-01-03 17:49:49 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
@SuppressLintを消したいです |
https://teratail.com/questions/376477?rss=all
|
|
2022-01-03 17:47:55 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
Wordpress date.php を使用した月別アーカイブの並び替え、URLの設定について |
https://teratail.com/questions/376476?rss=all
|
Wordpressdatephpを使用した月別アーカイブの並び替え、URLの設定について前提・実現したいことWordpressのnbspdatephpを使用して月別イベントページを作成しています。 |
2022-01-03 17:34:03 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
【C#(MVVM)】StackPanelをViewModel側で保持したい |
https://teratail.com/questions/376475?rss=all
|
イメージは下記のコードのLabelのようにViewwModel側はプロパティで状態を保持し、変更がある度、更新されるようにしたいです。 |
2022-01-03 17:33:18 |
Program |
[全てのタグ]の新着質問一覧|teratail(テラテイル) |
PHPエラーの対処法がわからない。 |
https://teratail.com/questions/376474?rss=all
|
PHPエラーの対処法がわからない。 |
2022-01-03 17:20:45 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
gphoto2を使ってカメラから画像を自動で取り込む |
https://qiita.com/t_hase/items/bad1b20a0a0aaf088fd1
|
そのため、コマンドラインでは無理と思い、rubyのPGをより操作することを検討しました。 |
2022-01-03 17:30:36 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
shallowオプション |
https://qiita.com/mmaumtjgj/items/a33fc12cbab9d81362be
|
shallowオプションshallowオプションとはルーティングの記述を複雑にせず、かつ深いネストを作らないというバランスを保つことのできるオプションのこと。 |
2022-01-03 17:24:06 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
【Rails】simple_formatとは |
https://qiita.com/mmaumtjgj/items/1b672f3accd37387b2f3
|
simpleformatの特徴・文字列をltpgtで囲む・改行にはltbrgtを付与・連続した改行については、ltpgtltpgtを付与記入法ltsimpleformat入力値gtsimpleformatの有無simpleformatなし本当は改行しているが、出力値では改行されていない。 |
2022-01-03 17:06:19 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
RSpecで表示順をテストする(SystemSpec) |
https://qiita.com/CoGee/items/d90e230beba727eb7a3f
|
つまり、pagetextの中に、イチロー任意の文字列ジローが含まれているかどうかをテストしており、ジロー任意の文字列イチローの場合は不一致となるため、表示順をテストすることができます。 |
2022-01-03 17:01:05 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
カフェに入ったらsshのグローバルIPでAWSのSGを開けれるシェル |
https://qiita.com/euroGoGo55/items/87cabd1edbe577586fb0
|
|
2022-01-03 17:50:58 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS認定データベース専門知識勉強メモ |
https://qiita.com/isobecky74/items/ef2b86f7edf932eb067e
|
GBのインスタンスならGBまでのバックアップは無料データ転送メンテナンスクラスター、インスタンスの設定変更ダウンタイムありインスタンス識別子の変更インスタンスクラスの変更バックアップ自動バックアップ自動スナップショットとトランザクションログがバックアップウィンドウ中に取得されるバックアップ保持期間日分の増分バックアップバックアップ開始の影響シングルAZ数秒間のIO中断マルチAZ数分間のレイテンシー上昇クラスター削除時に削除される手動スナップショット復元は新しいクラスターになるプロファイラープロファイリングされたコマンド、時間、プランの概要、クライアントメタデータがCloudwatchLogsにDB変更ストリームデータベース内のコレクションに対する変更イベントのログを重複なく順序を維持日間保持Lambdaなどで取得してESに流すなどAmazonDynamoDBパーティションデータ領域自動拡張テーブル内のパーティションキーから得られたハッシュキーをもとにデータを格納するパーティションが決まるプライマリキーテーブル全体で一意パーティションキー単体、パーティションキーとソートキーの複合ローカルセカンダリーインデックス同一のパーティションキーを持つデータを別の基準で絞り込みたい場合テーブル作成時のみパーティションキーのみのテーブルには定義できないベーステーブルからキャパシティーユニットを消費テーブルとインデックスの合計がGBまでグローバルセカンダリーインデックス異なるパーティションキーを持つItemを含むデータ群から絞り込みたい場合パーティションキー単体、パーティションキーとソートキーの複合キーを一意にする必要がないプライマリキーで検索できないパターンのキーの組み合わせを用いる場合に使うサイズ制限なしテーブル作成時、作成後の追加も可能結果整合性のみキャパシティーユニットは元テーブルとは別。 |
2022-01-03 17:18:45 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
shallowオプション |
https://qiita.com/mmaumtjgj/items/a33fc12cbab9d81362be
|
shallowオプションshallowオプションとはルーティングの記述を複雑にせず、かつ深いネストを作らないというバランスを保つことのできるオプションのこと。 |
2022-01-03 17:24:06 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
【Rails】simple_formatとは |
https://qiita.com/mmaumtjgj/items/1b672f3accd37387b2f3
|
simpleformatの特徴・文字列をltpgtで囲む・改行にはltbrgtを付与・連続した改行については、ltpgtltpgtを付与記入法ltsimpleformat入力値gtsimpleformatの有無simpleformatなし本当は改行しているが、出力値では改行されていない。 |
2022-01-03 17:06:19 |
Ruby |
Railsタグが付けられた新着投稿 - Qiita |
RSpecで表示順をテストする(SystemSpec) |
https://qiita.com/CoGee/items/d90e230beba727eb7a3f
|
つまり、pagetextの中に、イチロー任意の文字列ジローが含まれているかどうかをテストしており、ジロー任意の文字列イチローの場合は不一致となるため、表示順をテストすることができます。 |
2022-01-03 17:01:05 |
技術ブログ |
Developers.IO |
Amazon SNSでメッセージのバッチ(一括)送信出来るようになっていたのでためしてみた |
https://dev.classmethod.jp/articles/amazon-sns-publish-batch/
|
publish |
2022-01-03 08:46:19 |
海外TECH |
DEV Community |
Create React App - Mind Map. Part 7 of 10: Chart |
https://dev.to/101samovar/create-react-app-mind-map-part-6-of-10-chart-1cbf
|
Create React App Mind Map Part of ChartThe Chart is the most interesting part of the MindMap App Let s create a separate component for the chart A functional component And the chart module css file for the styling Source code Our channel |
2022-01-03 08:33:50 |
海外TECH |
DEV Community |
A11y tips: what is ARIA and when to use it |
https://dev.to/carlosespada/a11y-tips-what-is-aria-and-when-to-use-it-2ncd
|
Ay tips what is ARIA and when to use itARIA stands for Accessible Rich Internet Applications and consists of a set of attributes and values that are added to HTML tags to offer extra information to assistive technologies and thus improve their experience It is about communicating what happens on a page what it means and how you can interact with it And when might it be necessary to use ARIA Only in these cases If the feature is available in HTML but it is not implemented or it is implemented but accessibility support is not If the feature is not currently available in HTML If the visual design constraints rule out the use of a particular native element because the element cannot be styled as required In other words ARIA should never be used to fix meaningless or incorrect HTML or to rewrite behaviors that already come natively in the browser using less suitable ones with added ARIA roles A very common example might be trying to emulate a button using a lt div gt with ARIA attributes Don t do it Use a lt button gt it will always be the best option no matter how hard you try to imitate it Remember the first rule of ARIA is Don t use ARIA The less it is used the better Try to solve your problems first using what very capable people have thought before working on our technologies for years |
2022-01-03 08:03:20 |
海外TECH |
DEV Community |
React Component Testing |
https://dev.to/ohdylan/react-component-testing-54ie
|
React Component TestingIn our last article we have introduced the usage of Jest to test our JavaScript code Start Testing Your JavaScript Code with Jest We are going to further extend the topic to introduce how do we use React Testing Library and Jest to test our React components React Testing Library and Jest are provided out of the box support with create react app and we do not need to install them separately React Testing Library RTL is built on top of the DOM testing library as in the tests will work with the actual DOM This allows the tests to simulate the ways that users will interact with DOM as closer as possible It is super easy to use provides an array of assertion methods extended from Jest user events simulation and etc create react app uses Jest as its test runner Jest will look for the test files name with the following naming conventions according to official site Files with js suffix in tests folders Files with test js suffix Files with spec js suffix Today we are going to explore how render our components to be tested finding the right element in the component and performing snapshot testing Let s get started with creating a new create react app project npx create react app testing react demoAfter the creation change directory into the app that you created and open the directory in your desired code editor You should already see an App test js in the src folder import render screen from testing library react import App from App test renders learn react link gt render lt App gt const linkElement screen getByText learn react i expect linkElement toBeInTheDocument You may remove this file or leave it I will remove it for this demonstration and therefore you will not see it being included in the test suites What I will normally do next is that I will create a components folder and include the files such as css and test files that belong to this component inside this folder After created components folder create two more folders called SubscribeForm and PokeSearch These are the two components that we want to write some tests on today Let s create our first simple component in SubscribeForm folder SubscribeForm jsimport React useState from react import SubscribeForm css const SubscribeForm gt const isDisabled setIsDisabled useState true const email setEmail useState function handleChange e setEmail e target value setIsDisabled e target value return lt div className container gt lt h gt Subscribe To Our Newsletter lt h gt lt form className form gt lt label htmlFor email gt Email Address lt label gt lt input onChange handleChange type email id email name email placeholder Email Address value email gt lt input type checkbox name agreement checkbox id agreement checkbox gt lt label htmlFor agreement checkbox gt I agree to disagree whatever the terms and conditions are lt label gt lt button name subscribe button type submit className button disabled isDisabled gt Subscribe lt button gt lt form gt lt div gt export default SubscribeForm This is a simple component where we have an input field for email address and a button to hit subscribe The button is first disabled and prevent clicking before any text is entered to the input field This button seems to be one of the perfect test cases that we can create Button is disabled before text inputButton is enabled after text inputFollowed by this we are going to create another component called PokeSearch I am not a Pokemon fan but Poke API is good for demonstration As another simple enough example we have a component that has a useEffect hook to fetch information from an API and display it Pokemon name to the screen Before the result is fetched we display a Loading text to users PokeSearch jsimport React useEffect useState from react const PokeSearch gt const pokemon setPokemon useState const isLoading setIsLoading useState true useEffect gt fetch then res gt res json then result gt setPokemon result setIsLoading false catch err gt console log err return lt div gt isLoading lt h gt Loading lt h gt lt p gt pokemon name lt p gt lt div gt export default PokeSearch Let s jump into testing these two components For our first component SubscribeForm component we create a new file called SubscribeForm test js We followed the naming convention so that it could be recognized by our test runner In order to create tests we will need render and screen from testing library react and the user events from testing library user event Besides remember to import the component that we want to test import React from react import render screen from testing library react import userEvent from testing library user event import SubscribeForm from SubscribeForm We can first create a test to ensure that our button is disabled when the page first loaded since there is no input in the email address field it The subscribe button is disabled before typing anything in the input text box gt render lt SubscribeForm gt expect screen getByRole button name subscribe i toBeDisabled From the last article we know that we will give a name to our test and provide a callback function which includes the assertions First we use render method to render the component to be tested in a container which is appended to document body on a side note Jest and before is using jsdom as default environment After rendering out the component we need to have a way to find the right element which is the button to test We can use query methods from RTL to do so The elements in DOM can be found by their accessibility roles and names more on this later or by text or by test id that we give to the elements There is a priority given by official statements They recommend to query by role or text where everyone is accessible by semantic HTML alt text such as img area etc and by test id user cannot see or hear this therefore if you could not make sense of using any of previous methods use this lt div data testid test element gt screen getByTestId test element You can find more information about the priority here About Queries of React Testing Library priority You can do this to find out the accessible roles within your component You can just write screen getByRole in the test for that component it will fail but give you the accessibility information and the name of those elements Here are the accessible roles heading Name Subscribe To Our Newsletter lt h gt textbox Name Email Address lt input id email name email placeholder Email Address type email value gt checkbox Name I agree to disagree whatever the terms and conditions are lt input id agreement checkbox name agreement checkbox type checkbox gt button Name Subscribe lt button class button disabled name subscribe button type submit gt From here we know that we have different accessibility roles such as button textbox checkbox and heading In order to target our subscribe button we need to target role button After targeting the role we want specifically the button with the accessible name Subscribe as stated in the accessibility information provided Name Subscribe This value of Name can be derived from visible or invisible property of an element the text in the button is one of them In order to search for its name we usually put insensitive case for regex on the name into the second object argument of getByRole name subscribe i After getting that button we want to check if this button is disabled it should be disabled Then we have the second test In this test we simulate the user event to type something in the text box and make the button enabled it The subscribe button becomes enabled when we start typing in the input text box gt render lt SubscribeForm gt userEvent type screen getByRole textbox name email i abc email com expect screen getByRole button name subscribe i toBeEnabled We use the same step to render the SubscribeForm to the document and use user event of type to type some text on the element that we want in this case it is the textbox that we can select by accessible role and name refer back to the accessibility information that we took just now The second argument of userEvent type is the text that you want to input After the text has been typed we can now expect the button to be enabled Finally we are doing a snapshot testing for our React componenet We need to use react test renderer to render a pure JavaScript object does not depend on DOM for the snapshot npm install react test rendererAfter installing and importing we can use the renderer to create SubscribeForm component in JavaScript Object Finally we use a toMatchSnapshot function from Jest to kickstart the snapshot testing it Test to match snapshot of component gt const subscribeFormTree renderer create lt SubscribeForm gt toJSON expect subscribeFormTree toMatchSnapshot When you run this test for the first time it will create a new folder automatically after you run the test called snapshots within your directory in this case is the SubscribeForm folder PASS src components PokeSearch PokeSearch test js PASS src components SubscribeForm SubscribeForm test js › snapshot written Snapshot Summary › snapshot written from test suite Test Suites passed totalTests passed totalSnapshots written totalTime sRan all test suites Watch Usage Press w to show more You can find a snap document in it SubscribeForm test js snap Jest Snapshot v exports Test to match snapshot of component lt div className container gt lt h gt Subscribe To Our Newsletter lt h gt lt form className form gt lt label htmlFor email gt Email Address lt label gt lt input id email name email onChange Function placeholder Email Address type email value gt lt input id agreement checkbox name agreement checkbox type checkbox gt lt label htmlFor agreement checkbox gt I agree to disagree whatever the terms and conditions are lt label gt lt button className button disabled true name subscribe button type submit gt Subscribe lt button gt lt form gt lt div gt Now that the test suite take note of your previous snapshot of the component If you run the test again it will take another snapshot of the compoenent and compare to the one in snapshots folder If they are different the test is going to fail This is useful to make sure that our UI components did not get changed unexpectedly Let s try to make a change to our SubscribeForm component and run the test again We are going to change Subscribe to Our Newsletter to Subscribe to Their Newsletter lt h gt Subscribe To Their Newsletter lt h gt Then we run the test again PASS src components PokeSearch PokeSearch test js FAIL src components SubscribeForm SubscribeForm test js Test to match snapshot of component expect received toMatchSnapshot Snapshot name Test to match snapshot of component Snapshot Received lt div className container gt lt h gt Subscribe To Our Newsletter Subscribe To Their Newsletter lt h gt lt form className form gt lt label it Test to match snapshot of component gt const subscribeFormTree renderer create lt SubscribeForm gt toJSON gt expect subscribeFormTree toMatchSnapshot at Object lt anonymous gt src components SubscribeForm SubscribeForm test js › snapshot failed Snapshot Summary › snapshot failed from test suite Inspect your code changes or press u to update them Test Suites failed passed totalTests failed passed totalSnapshots failed totalTime sRan all test suites Watch Usage Press w to show more and the test failed If this is an intended change we can update our snapshot to the latest by pressing u By doing that the snap file in our snapshots folder will get updated all the tests are re run and they pass this time This is pretty similar to what we used Enzyme library last time PASS src components PokeSearch PokeSearch test js PASS src components SubscribeForm SubscribeForm test js › snapshot updated Snapshot Summary › snapshot updated from test suite Test Suites passed totalTests passed totalSnapshots updated totalTime sRan all test suites Watch Usage Press w to show more Therefore this is the complete script to test our SubscribeForm component import React from react import render screen from testing library react import userEvent from testing library user event import renderer from react test renderer import SubscribeForm from SubscribeForm it The subscribe button is disabled before typing anything in the input text box gt render lt SubscribeForm gt expect screen getByRole button name subscribe i toBeDisabled it The subscribe button becomes enabled when we start typing in the input text box gt render lt SubscribeForm gt userEvent type screen getByRole textbox name email i abc email com expect screen getByRole button name subscribe i toBeEnabled it Test to match snapshot of component gt const subscribeFormTree renderer create lt SubscribeForm gt toJSON expect subscribeFormTree toMatchSnapshot Note to mention There is a clean up process afterEach cleanup done to prevent memory leak automatically by Jest injected globally after each test Finally we would also like to test our component asynchronously PokeSearch import React from react import render screen waitForElementToBeRemoved from testing library react import PokeSearch from PokeSearch it Loading is shown until the Pokemon is fetched async gt render lt PokeSearch gt expect screen getByText Loading toBeInTheDocument await waitForElementToBeRemoved screen queryByText Loading First we can test if the Loading text is rendered correctly to the screen We need to query on the correct element that contains Loading and use assertion method to check if it is in the DOM Then we can use an asynchronous function provided by RTL to be resolved by the loading text element to disappear after the result is fetched Besides it is also recommended by official site to use queryBy to query for the element to disappear from DOM After testing the Loading text we can then test the case after fetched In this test case we do not want to test with the real API we are just ensuring that our component is working fine there we can just mock the fetch function We fix the returned data by the fetch function when the promise is resolved After that we will render the PokeSearch and the fetch call is made to fetch our fake data After the data is back we will try to use findBy use findBy for asynchronous case to find for the element that has text bulbasaur and check if the element is in the DOM it The Pokemon name is displayed correctly after it has been fetched async gt Mock the browser fetch function window fetch jest fn gt const pokemon name bulbasaur weight height return Promise resolve json gt Promise resolve pokemon render lt PokeSearch gt const pokemonName await screen findByText bulbasaur expect pokemonName toBeInTheDocument Hope this gives you an insight on how do get started on testing React components Do follow me for more future articles on web design programming and self improvement |
2022-01-03 08:02:43 |
海外ニュース |
Japan Times latest articles |
U.S. and China growing tensions may jeopardize security in East Asia in 2022 |
https://www.japantimes.co.jp/news/2022/01/03/asia-pacific/us-china-tension-2022/
|
U S and China growing tensions may jeopardize security in East Asia in While China is expected to intensify provocations against Taiwan U S North Korea talks on denuclearization are almost certain to make no headway |
2022-01-03 17:24:47 |
海外ニュース |
Japan Times latest articles |
Reigning MVP Nikola Jokic reflects on early days in NBA |
https://www.japantimes.co.jp/sports/2022/01/03/basketball/nba/jokic-early-nba-days/
|
denver |
2022-01-03 17:18:40 |
海外ニュース |
Japan Times latest articles |
Countdown to Beijing Winter Games marred by controversy, COVID-19 and boycotts |
https://www.japantimes.co.jp/sports/2022/01/03/olympics/winter-olympics/beijing-games-countdown/
|
Countdown to Beijing Winter Games marred by controversy COVID and boycottsRights groups have long called for a boycott over China s human rights record especially its treatment of Uyghur Muslims in the northwest region of Xinjiang |
2022-01-03 17:14:00 |
ニュース |
BBC News - Home |
World Cup, Commonwealth Games - what else lies in store for women's rugby union in 2022? |
https://www.bbc.co.uk/sport/rugby-union/59843079?at_medium=RSS&at_campaign=KARANGA
|
World Cup Commonwealth Games what else lies in store for women x s rugby union in The next months promise to be intriguing on and off the pitch as the global game gears up again after a Covid enforced pause and players find their voice |
2022-01-03 08:16:22 |
LifeHuck |
ライフハッカー[日本版] |
【Amazon初売り】23%オフ、スマホなどが置けるテーブル付きフィットネスバイク |
https://www.lifehacker.jp/2022/01/amazon-timesale-hatsuuri-2022-0103-3.html
|
amazon |
2022-01-03 17:15:00 |
北海道 |
北海道新聞 |
東京で新たに103人感染 新型コロナ |
https://www.hokkaido-np.co.jp/article/629693/
|
新型コロナウイルス |
2022-01-03 17:19:00 |
北海道 |
北海道新聞 |
道内10人感染、札幌は7人 新型コロナ |
https://www.hokkaido-np.co.jp/article/629683/
|
新型コロナウイルス |
2022-01-03 17:16:02 |
北海道 |
北海道新聞 |
NFLベンガルズ6季ぶり地区V タイタンズは2季連続制覇 |
https://www.hokkaido-np.co.jp/article/629692/
|
連続 |
2022-01-03 17:12:00 |
IT |
週刊アスキー |
転ぶと痛いのは嫌なので味わいに極振りしたHonda「GB350」 |
https://weekly.ascii.jp/elem/000/004/079/4079370/
|
honda |
2022-01-03 17:30:00 |
ニュース |
THE BRIDGE |
米国のIPOラッシュで話題、インシュアテックの最新動向 |
https://thebridge.jp/2022/01/its-all-about-insuretech
|
米国のIPOラッシュで話題、インシュアテックの最新動向本稿は独立系ベンチャーキャピタルSTRIVEによるものを一部要約して転載させていただいた。 |
2022-01-03 08:26:22 |
コメント
コメントを投稿