mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-24 18:24:52 +00:00 
			
		
		
		
	* convert Cypress tests to TypeScript this work was done by @lunaisnotaboy https://github.com/lunaisnotaboy for their fork https://github.com/cutiekey/cutiekey/pull/7 I just repacked their changes into a minimal set * fix call to `window` in cypress tests this error was spotted thanks to the TypeScript compiler: ``` support/commands.ts:33:12 - error TS2559: Type '(win: any) => void' has no properties in common with type 'Partial<Loggable & Timeoutable>'. 33 cy.window(win => { ~~~~~~~~ Found 1 error in support/commands.ts:33 ``` (again, @lunaisnotaboy did the actual work)
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /*
 | ||
|  * SPDX-FileCopyrightText: syuilo and misskey-project
 | ||
|  * SPDX-License-Identifier: AGPL-3.0-only
 | ||
|  */
 | ||
| 
 | ||
| describe('Router transition', () => {
 | ||
| 	describe('Redirect', () => {
 | ||
| 		// サーバの初期化。ルートのテストに関しては各describeごとに1度だけ実行で十分だと思う(使いまわした方が早い)
 | ||
| 		before(() => {
 | ||
| 			cy.resetState();
 | ||
| 
 | ||
| 			// インスタンス初期セットアップ
 | ||
| 			cy.registerUser('admin', 'pass', true);
 | ||
| 
 | ||
| 			// ユーザー作成
 | ||
| 			cy.registerUser('alice', 'alice1234');
 | ||
| 
 | ||
| 			cy.login('alice', 'alice1234');
 | ||
| 
 | ||
| 			// アカウント初期設定ウィザード
 | ||
| 			// 表示に時間がかかるのでデフォルト秒数だとタイムアウトする
 | ||
| 			cy.get('[data-cy-user-setup] [data-cy-modal-window-close]', { timeout: 30000 }).click();
 | ||
| 			cy.wait(500);
 | ||
| 			cy.get('[data-cy-modal-dialog-ok]').click();
 | ||
| 		});
 | ||
| 
 | ||
| 		it('redirect to user profile', () => {
 | ||
| 			// テストのためだけに用意されたリダイレクト用ルートに飛ぶ
 | ||
| 			cy.visit('/redirect-test');
 | ||
| 
 | ||
| 			// プロフィールページのURLであることを確認する
 | ||
| 			cy.url().should('include', '/@alice')
 | ||
| 		});
 | ||
| 	});
 | ||
| });
 |